diff --git a/pkgs/eyezoom.nix b/pkgs/eyezoom.nix index 68ee2c9..3fb7d0c 100644 --- a/pkgs/eyezoom.nix +++ b/pkgs/eyezoom.nix @@ -1,17 +1,23 @@ { pkgs, ... }: pkgs.writeScript "eyezoom" '' -W=1920 -H=1080 +arg="$1" -offx=1600 -offy=0 +set -- $( + ${pkgs.xorg.xrandr}/bin/xrandr | + ${pkgs.gawk}/bin/awk -F "[x+ ]" '/primary/ { print $4" "$5" "$6" "$7 }' + ) + +W="$1" +H="$2" +offx="$3" +offy="$4" HFACTOR=10 WFACTOR=4 WIDEDIV=2 -case "$1" in +case "$arg" in eye) ${pkgs.wmctrl}/bin/wmctrl -R ':ACTIVE:' -e 0,$offx,$(( offy - (H * HFACTOR / 2) + (H / 2) )),$W,$((H*HFACTOR)) ;;