aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-11-18 12:17:19 -0700
committerJosh Rahm <rahm@google.com>2022-11-18 12:17:19 -0700
commit3c49e047d920c8662b61726460df3eb31df0b146 (patch)
tree01afa018c763def024c01b0a907661309120411a /src/Rahm/Desktop/Keys.hs
parentd728b726fa02d4b8acc4c66402e8477c4c1bf258 (diff)
downloadrde-3c49e047d920c8662b61726460df3eb31df0b146.tar.gz
rde-3c49e047d920c8662b61726460df3eb31df0b146.tar.bz2
rde-3c49e047d920c8662b61726460df3eb31df0b146.zip
Add "Theater" concept.
This is the set of the current set of screens and workspaces. It can be saved and restored. In a sense it works like how most other tiling managers handle "workspaces" where one can change all screens at once. Not that it's a superior system to XMonad (it's not), but it's sometimes helpful.
Diffstat (limited to 'src/Rahm/Desktop/Keys.hs')
-rw-r--r--src/Rahm/Desktop/Keys.hs30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs
index b57d310..fb49394 100644
--- a/src/Rahm/Desktop/Keys.hs
+++ b/src/Rahm/Desktop/Keys.hs
@@ -64,6 +64,8 @@ import Rahm.Desktop.Submap
import Rahm.Desktop.Swallow
import Rahm.Desktop.SwapMaster (swapMaster)
import Rahm.Desktop.Workspaces
+import Rahm.Desktop.Theater
+
import qualified Rahm.Desktop.StackSet as W
import Rahm.Desktop.History
@@ -281,10 +283,18 @@ keymap = runKeys $ do
runMaybeT_ $ (lift . gotoWorkspaceFn) =<< readNextWorkspace
shiftMod $
- doc "Swap a workspace with another workspace." $
- runMaybeT_ $
- lift . windows . uncurry W.swapWorkspaces =<<
- (,) <$> readNextWorkspaceName <*> readNextWorkspaceName
+ doc "Restore the theater marked with the next typed character." $
+ runMaybeT_ $ do
+ mapNextString $ \_ str -> lift $
+ case str of
+ [ch] | isAlpha ch -> restoreTheater [ch]
+ _ -> return ()
+
+ -- shiftMod $
+ -- doc "Swap a workspace with another workspace." $
+ -- runMaybeT_ $
+ -- lift . windows . uncurry W.swapWorkspaces =<<
+ -- (,) <$> readNextWorkspaceName <*> readNextWorkspaceName
controlMod $
doc "Move the current focused window to another workspace and view that workspace" $
@@ -400,12 +410,12 @@ keymap = runKeys $ do
doc "For mosaic layout, shrink the size-share of the current window" $
sendMessage =<< shrinkPositionAlt
- bind xK_m $
+ bind xK_m $ do
justMod $
doc "Mark the current window with the next typed character." $ do
locs <- fromMaybe [] <$> runMaybeT readNextLocationSet
let wins = mapMaybe locationWindow locs
- withBorderWidth 4 wins $
+ withBorderWidth 2 wins $
withBorderColor "#00ffff" wins $ do
runMaybeT_ $ do
mapNextString $ \_ str -> lift $
@@ -413,6 +423,14 @@ keymap = runKeys $ do
[ch] | isAlpha ch -> markAllLocations str locs
_ -> return ()
+ shiftMod $
+ doc "Mark the current theater with the next typed character." $
+ runMaybeT_ $ do
+ mapNextString $ \_ str -> lift $
+ case str of
+ [ch] | isAlpha ch -> saveCurrentTheater str
+ _ -> return ()
+
bind xK_plus $ do
justMod $
doc "Increase the number of windows in the master region." $