diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2022-04-10 13:26:16 -0600 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-04-10 13:26:16 -0600 |
| commit | fada61902291aeb29914fff288301a8c487c4ecd (patch) | |
| tree | 047655195f50efcbd51db8f825acf589dc6abead /src/Rahm/Desktop/ScreenRotate.hs | |
| parent | bf2e2459f800f953d95681a937051fcf56ac79aa (diff) | |
| download | rde-fada61902291aeb29914fff288301a8c487c4ecd.tar.gz rde-fada61902291aeb29914fff288301a8c487c4ecd.tar.bz2 rde-fada61902291aeb29914fff288301a8c487c4ecd.zip | |
Rename Internal to Rahm.Desktop
Diffstat (limited to 'src/Rahm/Desktop/ScreenRotate.hs')
| -rw-r--r-- | src/Rahm/Desktop/ScreenRotate.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Rahm/Desktop/ScreenRotate.hs b/src/Rahm/Desktop/ScreenRotate.hs new file mode 100644 index 0000000..1f238b1 --- /dev/null +++ b/src/Rahm/Desktop/ScreenRotate.hs @@ -0,0 +1,19 @@ +module Rahm.Desktop.ScreenRotate where + +import XMonad.StackSet as W + +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 = tail $ cycle $ map W.workspace screens + (current':visible') = zipWith (\s w -> s {workspace = w} ) screens workspaces + in W.StackSet current' visible' others floating + +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 = 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 |