diff options
| author | Josh Rahm <rahm@josher.dev> | 2026-04-02 18:54:41 -0600 |
|---|---|---|
| committer | Josh Rahm <rahm@josher.dev> | 2026-04-02 18:54:41 -0600 |
| commit | 65c68092cbccc2c54ea792b6d09f643edbebd4de (patch) | |
| tree | 264336230a6d318aaf20290a3b711da690c6ee5b /src/Rahm | |
| parent | fab982243798b2900796b2ca308df345626cdbef (diff) | |
| download | rde-65c68092cbccc2c54ea792b6d09f643edbebd4de.tar.gz rde-65c68092cbccc2c54ea792b6d09f643edbebd4de.tar.bz2 rde-65c68092cbccc2c54ea792b6d09f643edbebd4de.zip | |
Commits specific to my yoga thinkpad.
Diffstat (limited to 'src/Rahm')
| -rw-r--r-- | src/Rahm/Desktop/Keys.hs | 51 |
1 files changed, 51 insertions, 0 deletions
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 |