aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/ScreenRotate.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-03-24 10:38:05 -0600
committerJosh Rahm <rahm@google.com>2022-03-24 10:38:05 -0600
commit4e718217ada0367b220f0e2134dbf6cbdcb28977 (patch)
tree47d70f94f530f94b7a7da2cecdb5e2c847dfe298 /src/Internal/ScreenRotate.hs
parenta87cbc7357566b26c7dca7538d4b03da5f8b999a (diff)
downloadrde-4e718217ada0367b220f0e2134dbf6cbdcb28977.tar.gz
rde-4e718217ada0367b220f0e2134dbf6cbdcb28977.tar.bz2
rde-4e718217ada0367b220f0e2134dbf6cbdcb28977.zip
Add more mouse motions. Add bindings for navigation to button15+<>
Diffstat (limited to 'src/Internal/ScreenRotate.hs')
-rw-r--r--src/Internal/ScreenRotate.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Internal/ScreenRotate.hs b/src/Internal/ScreenRotate.hs
new file mode 100644
index 0000000..ff6417c
--- /dev/null
+++ b/src/Internal/ScreenRotate.hs
@@ -0,0 +1,19 @@
+module Internal.ScreenRotate where
+
+import XMonad.StackSet as W
+
+screenRotateForward :: W.StackSet i l a sid sd -> W.StackSet i l a sid sd
+screenRotateForward (W.StackSet current visible others floating) = do
+ let screens = current : visible
+ workspaces = tail $ cycle $ map W.workspace screens
+ (current':visible') = zipWith (\s w -> s {workspace = w} ) screens workspaces
+ in W.StackSet current' visible' others floating
+
+screenRotateBackward :: W.StackSet i l a sid sd -> W.StackSet i l a sid sd
+screenRotateBackward (W.StackSet current visible others floating) = do
+ let screens = current : visible
+ workspaces = rcycle $ map W.workspace screens
+ (current':visible') = zipWith (\s w -> s {workspace = w} ) screens workspaces
+ in W.StackSet current' visible' others floating
+
+ where rcycle l = last l : l