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.hs60
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,