From d3d67d059d2b56ceac63cebaa34802f2fb5a5019 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Sun, 20 Nov 2022 17:11:34 -0700 Subject: 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 "*"). --- src/Rahm/Desktop/Keys.hs | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'src/Rahm/Desktop/Keys.hs') 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." $ -- cgit