diff --git a/flake.nix b/flake.nix index 6653171..d246c1d 100644 --- a/flake.nix +++ b/flake.nix @@ -71,6 +71,7 @@ renoise = self.packages.${system}.renoise; wall = self.packages.${system}.wall; protonmail-desktop = self.packages.${system}.protonmail-desktop; + eyezoom = self.packages.${system}.eyezoom; }; }; }; @@ -121,6 +122,7 @@ renoise = import ./pkgs/renoise.nix { inherit pkgs; }; wall = import ./pkgs/wall.nix { inherit pkgs; }; protonmail-desktop = import ./pkgs/protonmail-desktop.nix { inherit pkgs; }; + eyezoom = import ./pkgs/eyezoom.nix { inherit pkgs; }; }; }); } diff --git a/home-manager/plasma.nix b/home-manager/plasma.nix index c988d7e..9c7ee5a 100644 --- a/home-manager/plasma.nix +++ b/home-manager/plasma.nix @@ -13,12 +13,30 @@ appearance.wallpaper = "${extra.wall}"; }; - hotkeys.commands."launch-alacritty" = { - name = "Launch alacritty"; + hotkeys.commands."launch-terminal" = { + name = "Launch terminal"; key = "Meta+Return"; command = "wezterm"; }; + hotkeys.commands."eye" = { + name = "eye zoom"; + key = "Alt+PageUp"; + command = "${extra.eyezoom} eye"; + }; + + hotkeys.commands."default" = { + name = "default zoom"; + key = "Alt+PageDown"; + command = "${extra.eyezoom} default"; + }; + + hotkeys.commands."thin" = { + name = "thin zoom"; + key = "Alt+Home"; + command = "${extra.eyezoom} eye"; + }; + hotkeys.commands."cpypsk" = { name = "Launch cpypsk"; key = "Meta+p"; diff --git a/pkgs/eyezoom.nix b/pkgs/eyezoom.nix new file mode 100644 index 0000000..b1edbdc --- /dev/null +++ b/pkgs/eyezoom.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +pkgs.writeScript "eyezoom" '' +W=1920 +H=1080 + +offx=1600 +offy=0 + +HFACTOR=10 +WFACTOR=4 + +case "$1" in + eye) + ${pkgs.wmctrl}/bin/wmctrl -R 'Minecraft*' -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 'Minecraft*' -e 0,$offx,$offy,$W,$H + ;; +esac +''