From 4a6725d5c01c804c96205d99663606dec4d0327e Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 22 Jan 2023 10:44:53 +0530 Subject: add rotate scripts --- scripts/default.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'scripts') diff --git a/scripts/default.nix b/scripts/default.nix index 20808e7..72d0235 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -60,6 +60,21 @@ let fi ''; + touchscreen = "ELAN9008:00 04F3:2ED6"; + stylus = "ELAN9008:00 04F3:2ED6 Stylus Pen (0)"; + portait-transform = builtins.toString [ 0 (-1) 1 1 0 0 0 0 1 ]; + landscape-transform = builtins.toString [ 0 0 0 0 0 0 0 0 0 ]; + portrait = pkgs.writeScriptBin "portrait" '' + ${pkgs.xorg.xrandr}/bin/xrandr -o left + ${pkgs.xorg.xinput}/bin/xinput set-prop "${touchscreen}" --type=float "Coordinate Transformation Matrix" ${portait-transform} + ${pkgs.xorg.xinput}/bin/xinput set-prop "${stylus}" --type=float "Coordinate Transformation Matrix" ${portait-transform} + ''; + landscape = pkgs.writeScriptBin "landscape" '' + ${pkgs.xorg.xrandr}/bin/xrandr -o normal + ${pkgs.xorg.xinput}/bin/xinput set-prop "${touchscreen}" --type=float "Coordinate Transformation Matrix" ${landscape-transform} + ${pkgs.xorg.xinput}/bin/xinput set-prop "${stylus}" --type=float "Coordinate Transformation Matrix" ${landscape-transform} + ''; + in [ webcam @@ -69,4 +84,6 @@ in uploader battery tmux-fzf + portrait + landscape ] -- cgit v1.2.3