diff options
Diffstat (limited to 'src/Rahm/Desktop/Keys.hs')
| -rw-r--r-- | src/Rahm/Desktop/Keys.hs | 57 |
1 files changed, 38 insertions, 19 deletions
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs index 3b08f37..94308e5 100644 --- a/src/Rahm/Desktop/Keys.hs +++ b/src/Rahm/Desktop/Keys.hs @@ -118,7 +118,7 @@ import Rahm.Desktop.Layout.List toNextLayout, toPreviousLayout, ) -import Rahm.Desktop.Layout.PinWindow (toggleWindowPin) +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 @@ -569,10 +569,21 @@ keymap = runKeys $ do doc "Lock the screen" $ spawnX "xsecurelock" - bind xK_p $ + bind xK_p $ do justMod $ - doc "Pin a window" $ - withFocused toggleWindowPin + 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 $ @@ -709,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" @@ -998,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 @@ -1035,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 $ @@ -1120,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, |