From 65c68092cbccc2c54ea792b6d09f643edbebd4de Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 2 Apr 2026 18:54:41 -0600 Subject: Commits specific to my yoga thinkpad. --- src/Rahm/Desktop/Keys.hs | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'src/Rahm/Desktop/Keys.hs') diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs index 77c3ca3..bbf182f 100644 --- a/src/Rahm/Desktop/Keys.hs +++ b/src/Rahm/Desktop/Keys.hs @@ -197,6 +197,40 @@ mediaSeekBDoc = doc "Seek back 3 seconds" mediaSeekB mediaSeekFDoc = doc "Seek forward 12 seconds" mediaSeekF +-- Screen rotation functions +-- Screen + input rotation functions +rotateScreenNormal = + mapM_ + spawnX + [ "xrandr --output eDP-1 --rotate normal", + "xinput set-prop \"Wacom HID 527E Finger\" \"Coordinate Transformation Matrix\" 1 0 0 0 1 0 0 0 1", + "xinput set-prop \"Wacom HID 527E Pen Pen (0x80e64f93)\" \"Coordinate Transformation Matrix\" 1 0 0 0 1 0 0 0 1" + ] + +rotateScreen180 = + mapM_ + spawnX + [ "xrandr --output eDP-1 --rotate inverted", + "xinput set-prop \"Wacom HID 527E Finger\" \"Coordinate Transformation Matrix\" -1 0 1 0 -1 1 0 0 1", + "xinput set-prop \"Wacom HID 527E Pen Pen (0x80e64f93)\" \"Coordinate Transformation Matrix\" -1 0 1 0 -1 1 0 0 1" + ] + +rotateScreen90 = + mapM_ + spawnX + [ "xrandr --output eDP-1 --rotate right", + "xinput set-prop \"Wacom HID 527E Finger\" \"Coordinate Transformation Matrix\" 0 1 0 -1 0 1 0 0 1", + "xinput set-prop \"Wacom HID 527E Pen Pen (0x80e64f93)\" \"Coordinate Transformation Matrix\" 0 1 0 -1 0 1 0 0 1" + ] + +rotateScreen270 = + mapM_ + spawnX + [ "xrandr --output eDP-1 --rotate left", + "xinput set-prop \"Wacom HID 527E Finger\" \"Coordinate Transformation Matrix\" 0 -1 1 1 0 0 0 0 1", + "xinput set-prop \"Wacom HID 527E Pen Pen (0x80e64f93)\" \"Coordinate Transformation Matrix\" 0 -1 1 1 0 0 0 0 1" + ] + kcQ :: KeyCode kcQ = 24 @@ -377,6 +411,23 @@ bindings = do justMod mediaNextDoc shiftMod mediaSeekFDoc + -- Screen rotation bindings + bind xK_Up $ do + justMod $ + doc "Rotate screen to normal orientation" rotateScreenNormal + + bind xK_Down $ do + justMod $ + doc "Rotate screen 180 degrees" rotateScreen180 + + bind xK_Right $ do + justMod $ + doc "Rotate screen 90 degrees clockwise" rotateScreen90 + + bind xK_Left $ do + justMod $ + doc "Rotate screen 270 degrees clockwise (90 counter-clockwise)" rotateScreen270 + bind xK_Return $ do justMod swapMaster -- The only raw keybinding. It's a consistent way to launch xterm to unbrick -- cgit