aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2023-12-08 18:07:41 -0700
committerJosh Rahm <rahm@google.com>2023-12-08 18:07:41 -0700
commit04a1fd2e2f2eaa9878c4bc67351784d6685ca22b (patch)
tree9881f49abace6f5f07b8a7f81aa22e5b8eb5f9a0 /src/Rahm/Desktop/Keys.hs
parent36b1792d90b5e58f66c730652e9b0c2cd38570e7 (diff)
downloadrde-04a1fd2e2f2eaa9878c4bc67351784d6685ca22b.tar.gz
rde-04a1fd2e2f2eaa9878c4bc67351784d6685ca22b.tar.bz2
rde-04a1fd2e2f2eaa9878c4bc67351784d6685ca22b.zip
Fix some dragging behavior. Remove some conflicting bindings.
Diffstat (limited to 'src/Rahm/Desktop/Keys.hs')
-rw-r--r--src/Rahm/Desktop/Keys.hs78
1 files changed, 19 insertions, 59 deletions
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs
index 94308e5..ae293ee 100644
--- a/src/Rahm/Desktop/Keys.hs
+++ b/src/Rahm/Desktop/Keys.hs
@@ -295,15 +295,20 @@ keymap = runKeys $ do
let subkeys keysM = Submap (runKeys keysM config)
repeatable keysM = Repeat (runKeys keysM config)
- bind xK_apostrophe $
+ bind xK_apostrophe $ do
justMod $
- doc "Jump to a window" $
- pushPendingBuffer "' " $ do
- runMaybeT_ $ do
- l <- readNextLocationSet'
- case l of
- (h : _) -> lift (focusLocation h)
- _ -> return ()
+ doc "Jump to a window/tile currently dragging window" $ do
+ ifM
+ D.isDragging
+ (D.finishDrag >> withFocused D.sinkByWindowUnderCursor)
+ $ pushPendingBuffer "' " $ do
+ runMaybeT_ $ do
+ l <- readNextLocationSet'
+ case l of
+ (h : _) -> lift (focusLocation h)
+ _ -> return ()
+ shiftMod $
+ doc "Drag workspace to another." $ D.dragWindow
bind xK_semicolon $
justMod $
@@ -1083,20 +1088,14 @@ mouseMap = runButtons $ do
subMouse $ do
bind button3 $
noMod $
- doc "Move to workspace 's' (Spotify)" $
- noWindow (gotoWorkspace "s")
+ doc "Drag a workspace to a different screen" $
+ noWindow D.dragWorkspace
bind button1 $
noMod $
doc "Swap a window with another window by dragging." $
noWindow D.dragWindow
- bind button13 $ do
- noMod $
- doc "Kill the window under the cursor" $
- noWindow $
- click >> CopyWindow.kill1
-
bind button14 $ do
noMod $
doc "Pop the window under the cursor" $
@@ -1129,12 +1128,14 @@ mouseMap = runButtons $ do
subMouse $ do
bind button1 $
noMod $
- doc "Move the mouse under the cursor (like how Mod+leftMouse works)" $
+ doc
+ "Move the mouse under the cursor (like how Mod+leftMouse works)"
myMouseMoveWindow
bind button2 $
noMod $
- doc "Run the command that started a window." $
+ doc
+ "Run the command that started a window."
duplWindow
bind button3 $
@@ -1249,47 +1250,6 @@ mouseMap = runButtons $ do
)
in windows f >> escape
- let workspaceButtons =
- [ ( button2,
- "Swap the master window with the one under the cursor",
- noWindow swapMaster
- ),
- ( button9,
- "View the next workspace",
- noWindow $ viewAdjacent next
- ),
- ( button8,
- "View the previous workspace",
- noWindow $ viewAdjacent prev
- ),
- ( button4,
- "Focus the previous window in the stack",
- noWindow $ windows W.focusUp
- ),
- ( button5,
- "Focus the next window in the stack",
- noWindow $ windows W.focusDown
- ),
- ( button7,
- "Swap the current screen with the one to the right",
- noWindow $ do
- click
- runMaybeT_ $
- (lift . gotoWorkspaceFn) =<< workspaceForStringT ",."
- ),
- ( button6,
- "Swap the current screen with the one to the left",
- noWindow $ do
- click
- runMaybeT_ $
- (lift . gotoWorkspaceFn) =<< workspaceForStringT ";."
- )
- ]
-
- continuous $
- forM_ workspaceButtons $ \(b, d, a) ->
- bind b $ noMod $ doc d a
-
-- Bindings specific to a window. These are set similarly to th ekeymap above,
-- but uses a Query monad to tell which windows the keys will apply to.
--