nixos-config/pkgs/eyezoom.nix

29 lines
591 B
Nix
Raw Normal View History

2024-09-15 19:45:05 +02:00
{ pkgs, ... }:
pkgs.writeScript "eyezoom" ''
W=1920
H=1080
offx=1600
offy=0
HFACTOR=10
WFACTOR=4
2024-09-24 12:40:56 +02:00
WIDEDIV=2
2024-09-15 19:45:05 +02:00
case "$1" in
eye)
2024-09-24 12:40:56 +02:00
${pkgs.wmctrl}/bin/wmctrl -R ':ACTIVE:' -e 0,$offx,$(( offy - (H * HFACTOR / 2) + (H / 2) )),$W,$((H*HFACTOR))
2024-09-15 19:45:05 +02:00
;;
tiktok)
2024-09-24 12:40:56 +02:00
${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))
2024-09-15 19:45:05 +02:00
;;
*)
2024-09-24 12:40:56 +02:00
${pkgs.wmctrl}/bin/wmctrl -R ':ACTIVE:' -e 0,$offx,$offy,$W,$H
2024-09-15 19:45:05 +02:00
;;
esac
''