diff options
| author | Josh Rahm <rahm@google.com> | 2023-12-08 16:14:05 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2023-12-08 16:14:05 -0700 |
| commit | 8bbc3ce0d0ae10b5e7630779c970f38f0a767789 (patch) | |
| tree | 8d31ec2a97dd0ae880e2a5e3a2c29b8331d22976 /src/Rahm/Desktop/Keys.hs | |
| parent | 718d69736e5dfd946648e7a305c15281d9656466 (diff) | |
| parent | 9f176adbff807dafec2caee5e3b104e65caf9029 (diff) | |
| download | rde-8bbc3ce0d0ae10b5e7630779c970f38f0a767789.tar.gz rde-8bbc3ce0d0ae10b5e7630779c970f38f0a767789.tar.bz2 rde-8bbc3ce0d0ae10b5e7630779c970f38f0a767789.zip | |
Merge branch 'pinwindow'
Diffstat (limited to 'src/Rahm/Desktop/Keys.hs')
| -rw-r--r-- | src/Rahm/Desktop/Keys.hs | 60 |
1 files changed, 43 insertions, 17 deletions
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs index 76634b0..94308e5 100644 --- a/src/Rahm/Desktop/Keys.hs +++ b/src/Rahm/Desktop/Keys.hs @@ -42,6 +42,7 @@ import Graphics.X11.ExtraTypes.XF86 import Rahm.Desktop.Common ( Location (..), click, + duplWindow, focusLocation, getCurrentWorkspace, gotoWorkspace, @@ -51,7 +52,7 @@ import Rahm.Desktop.Common runMaybeT_, setBorderColor, withBorderColor, - withBorderColorM, duplWindow, + withBorderColorM, ) import Rahm.Desktop.DMenu (runDMenu) import qualified Rahm.Desktop.Dragging as D @@ -117,6 +118,7 @@ import Rahm.Desktop.Layout.List toNextLayout, toPreviousLayout, ) +import Rahm.Desktop.Layout.PinWindow (pinWindow, toggleWindowPin, unpinWindow, withWindowsUnpinned) import Rahm.Desktop.Layout.Pop (togglePop) import Rahm.Desktop.Layout.Rotate (rotateLayout) import Rahm.Desktop.Logger @@ -307,7 +309,7 @@ keymap = runKeys $ do justMod $ doc "Run the command which opened this window again." $ X.withFocused duplWindow - + bind xK_w $ do justMod $ doc "Swap windows with other windows" $ @@ -567,6 +569,22 @@ keymap = runKeys $ do doc "Lock the screen" $ spawnX "xsecurelock" + bind xK_p $ do + justMod $ + doc "Pin a windowset" $ + pushPendingBuffer "p " $ + runMaybeT_ $ + do + windows <- mapMaybe locationWindow <$> readNextLocationSet + lift $ mapM_ pinWindow windows + + shiftMod $ + doc "Unpin a windowset" $ + pushPendingBuffer "P " $ + runMaybeT_ $ do + windows <- mapMaybe locationWindow <$> readNextLocationSet + lift $ mapM_ unpinWindow windows + bind xK_minus $ do justMod $ doc @@ -702,17 +720,18 @@ keymap = runKeys $ do ) (W.findTag win stackset) - windows $ - finalSwap - . ( \ss -> - case shiftType of - ShiftAndFollow - | (w : _) <- selection, - Just ws <- W.findTag w ss -> - W.greedyView ws ss - _ -> ss - ) - . allMovements + withWindowsUnpinned selection $ + windows $ + finalSwap + . ( \ss -> + case shiftType of + ShiftAndFollow + | (w : _) <- selection, + Just ws <- W.findTag w ss -> + W.greedyView ws ss + _ -> ss + ) + . allMovements altMod $ spawnX "sudo -A systemctl suspend && xsecurelock" @@ -991,7 +1010,13 @@ myMouseMoveWindow = D.mouseMoveWindowAndThen X.focus $ mconcat [ D.ifReleased button3 D.sinkOnRelease, - D.ifReleased' button13 $ \w _ -> X.killWindow w + D.ifReleased' button2 $ \w _ -> X.killWindow w + ] + +myMouseResizeAction = + D.mouseResizeWindowAndThen X.focus $ + mconcat + [ D.ifReleased button1 D.sinkOnRelease ] mouseMap :: forall l. XConfig l -> ButtonBindings @@ -1028,8 +1053,9 @@ mouseMap = runButtons $ do bind button3 $ do justMod $ - doc "Float and resize a window" $ - \w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster + doc + "Float and resize a window" + myMouseResizeAction bind button6 $ justMod $ @@ -1113,7 +1139,7 @@ mouseMap = runButtons $ do bind button3 $ noMod $ - doc "Resize the window under the cursor" mouseResizeWindow + doc "Resize the window under the cursor" myMouseResizeAction let resizeButtons = [ ( button4, |