From eec0d7e3b76f40c83634a2b3100d717843a79a73 Mon Sep 17 00:00:00 2001 From: Rachel Lambda Samuelsson Date: Tue, 24 Sep 2024 12:40:56 +0200 Subject: [PATCH] add wide zoom --- home-manager/plasma.nix | 6 ++++++ pkgs/eyezoom.nix | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/home-manager/plasma.nix b/home-manager/plasma.nix index d8e48d6..9bba053 100644 --- a/home-manager/plasma.nix +++ b/home-manager/plasma.nix @@ -37,6 +37,12 @@ command = "${extra.eyezoom} tiktok"; }; + hotkeys.commands."wide" = { + name = "wide zoom"; + key = "Alt+Home"; + command = "${extra.eyezoom} wide"; + }; + hotkeys.commands."cpypsk" = { name = "Launch cpypsk"; key = "Meta+p"; diff --git a/pkgs/eyezoom.nix b/pkgs/eyezoom.nix index b1edbdc..68ee2c9 100644 --- a/pkgs/eyezoom.nix +++ b/pkgs/eyezoom.nix @@ -9,15 +9,20 @@ offy=0 HFACTOR=10 WFACTOR=4 +WIDEDIV=2 + case "$1" in eye) - ${pkgs.wmctrl}/bin/wmctrl -R 'Minecraft*' -e 0,$offx,$(( offy - (H * HFACTOR / 2) + (H / 2) )),$W,$((H*HFACTOR)) + ${pkgs.wmctrl}/bin/wmctrl -R ':ACTIVE:' -e 0,$offx,$(( offy - (H * HFACTOR / 2) + (H / 2) )),$W,$((H*HFACTOR)) ;; tiktok) - ${pkgs.wmctrl}/bin/wmctrl -R 'Minecraft*' -e 0,$(( offx - ((W/WFACTOR)/2) + (W/2))),$offy,$((W/WFACTOR)),$H + ${pkgs.wmctrl}/bin/wmctrl -R ':ACTIVE:' -e 0,$(( offx - ((W/WFACTOR)/2) + (W/2))),$offy,$((W/WFACTOR)),$H + ;; + wide) + ${pkgs.wmctrl}/bin/wmctrl -R ':ACTIVE:' -e 0,$offx,$(( offy - ((H / WIDEDIV) / 2) + (H / 2) )),$W,$((H/WIDEDIV)) ;; *) - ${pkgs.wmctrl}/bin/wmctrl -R 'Minecraft*' -e 0,$offx,$offy,$W,$H + ${pkgs.wmctrl}/bin/wmctrl -R ':ACTIVE:' -e 0,$offx,$offy,$W,$H ;; esac ''