aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2023-12-04 16:23:53 -0700
committerJosh Rahm <rahm@google.com>2023-12-04 16:23:53 -0700
commit1132a1b6468feb46dd5033d77855d9b4f2ae9d46 (patch)
tree6d7e4c1b671f48598177e534d979d04a9d27d75b /src/Rahm/Desktop/Keys.hs
parentea291e76b2ab45e13f648e82b63c4668974c2eae (diff)
downloadrde-1132a1b6468feb46dd5033d77855d9b4f2ae9d46.tar.gz
rde-1132a1b6468feb46dd5033d77855d9b4f2ae9d46.tar.bz2
rde-1132a1b6468feb46dd5033d77855d9b4f2ae9d46.zip
Better history. Works even when non-current screens change
Diffstat (limited to 'src/Rahm/Desktop/Keys.hs')
-rw-r--r--src/Rahm/Desktop/Keys.hs61
1 files changed, 41 insertions, 20 deletions
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs
index 9e3e427..55a0742 100644
--- a/src/Rahm/Desktop/Keys.hs
+++ b/src/Rahm/Desktop/Keys.hs
@@ -307,9 +307,10 @@ keymap = runKeys $ do
setAlternateWindows (l1'' ++ l2')
windows $ W.swapWindows $ zip l1'' l2' ++ zip l2' l1''
shiftMod $
- doc "Swap two workspaces (or rename the current one). \
- \(only works on normal workspaces)." $
- pushPendingBuffer "W "$ do
+ doc
+ "Swap two workspaces (or rename the current one). \
+ \(only works on normal workspaces)."
+ $ pushPendingBuffer "W " $ do
logs Debug "%s" . W.dbgStackSet =<< gets windowset
runMaybeT_ $ do
w1 <- readNextWorkspaceName
@@ -319,7 +320,6 @@ keymap = runKeys $ do
w2 <- readNextWorkspaceName
lift $ windows $ W.swapWorkspaces w1 w2
-
bind xK_BackSpace $ do
-- The only raw keybinding. Meant to get a terminal to unbrick XMonad if
-- something goes wrong with the keyboard layout and for first-time boots
@@ -451,22 +451,18 @@ keymap = runKeys $ do
(lift . gotoWorkspaceFn) =<< readNextWorkspace
shiftMod $
- doc
- "Switch to a different theater.\n\n\t\
- \Theaters are like super-workspaces. They are used for different\n\t\
- \'contexts'. Theaters share all the windows with eachother, but\n\t\
- \but each theater has its own mappings for window -> workspace. i.e.\n\t\
- \one theater can have window 'x' on workspace 'y', but another might\n\t\
- \have 'x' on 'z' instead. If a theater does explicity place a window,\n\t\
- \the window is placed in the hidden workspace (which is '*')\n"
- $ pushPendingBuffer "G " $
- runMaybeT_ $
- do
- mapNextString $ \_ str -> lift $
- case str of
- [ch] | isAlpha ch -> restoreTheater (Just [ch])
- [' '] -> restoreTheater Nothing
- _ -> return ()
+ doc "Switch a workspace with another workspace. \
+ \This is a more powerful version of the 'g' command, which does not\
+ \assume the current workspace.\
+ \which takes two workspaces as arguments and switches them whereas\
+ \the 'g' command operates only on the current workspace (.).\
+ \thereby G.<ws> is the same as g<ws>" $ do
+ pushPendingBuffer "G " $ do
+ runMaybeT_ $ do
+ w1 <- readNextWorkspaceName
+ lift $ addStringToPendingBuffer " "
+ w2 <- readNextWorkspaceName
+ lift $ windows $ W.switchWorkspaces w1 w2
bind xK_d $
justMod $
@@ -698,6 +694,26 @@ keymap = runKeys $ do
doc "Toggle the hole" $
sendMessage toggleHole
+ bind xK_g $
+ (noMod -|- justMod) $
+ doc
+ "Switch to a different theater.\n\n\t\
+ \Theaters are like super-workspaces. They are used for different\n\t\
+ \'contexts'. Theaters share all the windows with eachother, but\n\t\
+ \but each theater has its own mappings for window -> workspace. i.e.\n\t\
+ \one theater can have window 'x' on workspace 'y', but another might\n\t\
+ \have 'x' on 'z' instead. If a theater does explicity place a window,\n\t\
+ \the window is placed in the hidden workspace (which is '*')\n"
+ $ do
+ addStringToPendingBuffer "g "
+ runMaybeT_ $
+ do
+ mapNextString $ \_ str -> lift $
+ case str of
+ [ch] | isAlpha ch -> restoreTheater (Just [ch])
+ [' '] -> restoreTheater Nothing
+ _ -> return ()
+
let spaceResize = repeatable $ do
bind xK_bracketright $ do
noMod $
@@ -1056,6 +1072,11 @@ mouseMap = runButtons $ do
doc "Jump to the last location." $
noWindow (click >> jumpToLastLocation)
+ bind button1 $
+ noMod $
+ doc "'drag' a workspace to another screen" $
+ \w -> mouseMoveWindow w
+
let workspaceButtons =
[ ( button2,
"Swap the master window with the one under the cursor",