24 lines
456 B
Nix
24 lines
456 B
Nix
|
{ 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
|
||
|
''
|