aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-11-20 17:11:34 -0700
committerJosh Rahm <joshuarahm@gmail.com>2022-11-20 17:11:34 -0700
commitd3d67d059d2b56ceac63cebaa34802f2fb5a5019 (patch)
treee11ec28eb13d5682dd56f84de05bac8960bb4c06 /src/Rahm/Desktop/Keys.hs
parent27dac9cb0fad229c88144b432a957f1cbd067b98 (diff)
downloadrde-d3d67d059d2b56ceac63cebaa34802f2fb5a5019.tar.gz
rde-d3d67d059d2b56ceac63cebaa34802f2fb5a5019.tar.bz2
rde-d3d67d059d2b56ceac63cebaa34802f2fb5a5019.zip
Add "Theaters" to RDE.
A "Theater" is basically the state of the "StackSet". This means that jumping to a Theater will reset all the windows to where they were when the user last left that theater, or an empty theater if there is not. New windows that a theater does not know about are put in the "hidden" workspace (which is "*").
Diffstat (limited to 'src/Rahm/Desktop/Keys.hs')
-rw-r--r--src/Rahm/Desktop/Keys.hs25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs
index edeb77e..556b318 100644
--- a/src/Rahm/Desktop/Keys.hs
+++ b/src/Rahm/Desktop/Keys.hs
@@ -65,6 +65,7 @@ import Rahm.Desktop.Swallow
import Rahm.Desktop.SwapMaster (swapMaster)
import Rahm.Desktop.Workspaces
import Rahm.Desktop.Desktop
+import Rahm.Desktop.Theater
import qualified Rahm.Desktop.StackSet as W
import Rahm.Desktop.History
@@ -283,7 +284,7 @@ keymap = runKeys $ do
runMaybeT_ $ (lift . gotoWorkspaceFn) =<< readNextWorkspace
shiftMod $
- doc "Restore the theater marked with the next typed character." $
+ doc "Restore the desktop marked with the next typed character." $
runMaybeT_ $ do
mapNextString $ \_ str -> lift $
case str of
@@ -297,13 +298,13 @@ keymap = runKeys $ do
-- (,) <$> readNextWorkspaceName <*> readNextWorkspaceName
controlMod $
- doc "Move the current focused window to another workspace and view that workspace" $
+ doc "Restore a theater state" $
runMaybeT_ $ do
- ws <- readNextWorkspace
- loc <- lift getCurrentLocation
- lift $ do
- moveLocationToWorkspaceFn ws loc
- gotoWorkspaceFn ws
+ mapNextString $ \_ str -> lift $
+ case str of
+ [ch] | isAlpha ch -> restoreTheater (Just [ch])
+ [' '] -> restoreTheater Nothing
+ _ -> return ()
bind xK_n $ do
justMod $
@@ -423,13 +424,21 @@ keymap = runKeys $ do
_ -> return ()
shiftMod $
- doc "Mark the current theater with the next typed character." $
+ doc "Mark the current desktop with the next typed character." $
runMaybeT_ $ do
mapNextString $ \_ str -> lift $
case str of
[ch] | isAlpha ch -> saveCurrentDesktop str
_ -> return ()
+ controlMod $
+ doc "Mark the current theater with the next typed character." $
+ runMaybeT_ $ do
+ mapNextString $ \_ str -> lift $
+ case str of
+ [ch] | isAlpha ch -> saveCurrentTheater (Just str)
+ _ -> return ()
+
bind xK_plus $ do
justMod $
doc "Increase the number of windows in the master region." $