aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Rahm/Desktop/Keys.hs')
-rw-r--r--src/Rahm/Desktop/Keys.hs36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs
index 6e16c25..1bf1b2f 100644
--- a/src/Rahm/Desktop/Keys.hs
+++ b/src/Rahm/Desktop/Keys.hs
@@ -269,17 +269,18 @@ keymap = runKeys $ do
let selectWorkspace :: (KeySym, String) -> Maybe (X WorkspaceId)
selectWorkspace s = case s of
(_, [ch]) | isAlphaNum ch || ch == '*' -> Just $ return [ch]
- (_, "]") -> Just $ adjacentWorkspace next =<< getCurrentWorkspace
- (_, "[") -> Just $ adjacentWorkspace prev =<< getCurrentWorkspace
+ (_, "]") -> Just $ adjacentWorkspaceNotVisible next
+ =<< getCurrentWorkspace
+ (_, "[") -> Just $ adjacentWorkspaceNotVisible prev
+ =<< getCurrentWorkspace
+ (_, ")") -> Just $ adjacentWorkspace next =<< getCurrentWorkspace
+ (_, "(") -> Just $ adjacentWorkspace prev =<< getCurrentWorkspace
(_, "}") -> Just $ adjacentScreen next
(_, "{") -> Just $ adjacentScreen prev
(_, "^") -> Just firstWorkspaceId
(_, "$") -> Just lastWorkspaceId
- (_, "/") -> Just $ do
- cur <- getCurrentWorkspace
- fromMaybe cur <$> runMaybeT (do
- windowId <- MaybeT askWindowId
- MaybeT $ workspaceWithWindow windowId)
+ (_, "/") -> Just $ fromMaybe <$> getCurrentWorkspace <*> runMaybeT (
+ (MaybeT . workspaceWithWindow) =<< MaybeT askWindowId)
(_, " ") -> Just $ accompaningWorkspace <$> getCurrentWorkspace
_ -> Nothing
@@ -289,9 +290,11 @@ keymap = runKeys $ do
\Workspaces are alphanumeric characters. So if the next key typed is an\n\t\
\alphanumeric character, that's the workspace to operate on\n\n\
- \The following special characters can also reference workspaces:\n\t\t\
- \]: The next non-visible workspace\n\t\t\
- \[: The previous non-visible workspace\n\t\t\
+ \\tThe following special characters can also reference workspaces:\n\t\t\
+ \]: The next workspace, skipping those already visible.\n\t\t\
+ \[: The previous workspace, skipping those already visible.\n\t\t\
+ \): The next workspace.\n\t\t\
+ \(: The previous workspace.\n\t\t\
\}: The workspace on the screen to the right\n\t\t\
\{: The workspace on the screen to the left\n\t\t\
\<space>: The accompaningWorkspace (toggled case)\n\t\t\
@@ -299,8 +302,9 @@ keymap = runKeys $ do
\^: The first populated workspace\n\t\t\
\$: The last populated workspace\n\t\t\
\*: The hidden workspace.\n\t\t\
- \_: Black hole. Sending a window here closes it.\n\t\t\
- \F1: display this help.\n" $
+ \_: Black hole. Sending a window here closes it.\n\n\t\
+ \Other keybindings starting with H-g\n\t\t\
+ \F1: display this help.\n\n\t" $
mapNextStringWithKeysym $ \_ keysym str ->
case ((keysym, str), selectWorkspace (keysym, str)) of
(_, Just w) -> pushHistory $ gotoWorkspace =<< w
@@ -725,6 +729,14 @@ mouseMap = runButtons $ do
bind button2 $ noMod $ windows . W.sink
bind button3 $ noMod mouseResizeWindow
+ let swapButtons = [
+ (button6, windows W.swapDown),
+ (button7, windows W.swapUp)
+ ]
+
+ forM_ (map fst swapButtons) $ \b ->
+ bind b $ noMod $ \w -> click >> (continuous swapButtons b) w
+
bind button13 $ noMod $ subMouse $ do
bind button13 $ noMod $ subMouse $ do
bind button13 $ noMod $ noWindow $ spawnX "xsecurelock"