From 4e718217ada0367b220f0e2134dbf6cbdcb28977 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 24 Mar 2022 10:38:05 -0600 Subject: Add more mouse motions. Add bindings for navigation to button15+<> --- src/Internal/ScreenRotate.hs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/Internal/ScreenRotate.hs (limited to 'src/Internal/ScreenRotate.hs') 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 -- cgit