From 2637a8e5c9b725de1bf8018df752068ae88797dd Mon Sep 17 00:00:00 2001 From: depsterr Date: Tue, 24 Sep 2024 18:12:16 +0200 Subject: [PATCH] use accel instead of transform to fix kde issue --- pkgs/eyezoom.nix | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pkgs/eyezoom.nix b/pkgs/eyezoom.nix index 8dbfa0e..0403171 100644 --- a/pkgs/eyezoom.nix +++ b/pkgs/eyezoom.nix @@ -18,29 +18,25 @@ WFACTOR=4 WIDEDIV=2 mouse="pointer:Logitech MX Vertical" -zoomsens=0.1 -# calculated using this with x = x+1, y = y+1. works, not sure why... -# https://unix.stackexchange.com/questions/491531/how-to-avoid-mouse-cursor-jumping-while-using-xinput-coordinate-transformation-m -xpos=$(( offx + (W / 2) + 1 )) -ypos=$(( offy + (H / 2) + 1 )) -zoommatrix="$zoomsens 0 $(${pkgs.bc}/bin/bc -l <<< "(1-$zoomsens)*$xpos") 0 $zoomsens $(${pkgs.bc}/bin/bc -l <<< "(1-$zoomsens)*$ypos") 0 0 1" +normalaccel=0 +zoomaccel=-0.9 case "$arg" in eye) ${pkgs.wmctrl}/bin/wmctrl -R ':ACTIVE:' -e 0,$offx,$(( offy - (H * HFACTOR / 2) + (H / 2) )),$W,$((H*HFACTOR)) - xinput set-prop "pointer:Logitech MX Vertical" "Coordinate Transformation Matrix" $zoommatrix + xinput set-prop "pointer:Logitech MX Vertical" "libinput Accel Speed" $zoomaccel ;; tiktok) ${pkgs.wmctrl}/bin/wmctrl -R ':ACTIVE:' -e 0,$(( offx - ((W/WFACTOR)/2) + (W/2))),$offy,$((W/WFACTOR)),$H - xinput set-prop "pointer:Logitech MX Vertical" "Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1 + xinput set-prop "pointer:Logitech MX Vertical" "libinput Accel Speed" $normalaccel ;; wide) ${pkgs.wmctrl}/bin/wmctrl -R ':ACTIVE:' -e 0,$offx,$(( offy - ((H / WIDEDIV) / 2) + (H / 2) )),$W,$((H/WIDEDIV)) - xinput set-prop "pointer:Logitech MX Vertical" "Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1 + xinput set-prop "pointer:Logitech MX Vertical" "libinput Accel Speed" $normalaccel ;; *) ${pkgs.wmctrl}/bin/wmctrl -R ':ACTIVE:' -e 0,$offx,$offy,$W,$H - xinput set-prop "pointer:Logitech MX Vertical" "Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1 + xinput set-prop "pointer:Logitech MX Vertical" "libinput Accel Speed" $normalaccel ;; esac ''