From 32e6904dcac06a60d14c9d7e304c3528aaadfa1d Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Wed, 6 Dec 2023 13:47:27 -0700 Subject: Bunch of changes. Not good git ettiquite - Added ShiftAndSwap functionality, which allows user to shift a to a and then swap that workspace with another e.g. move Spotify to workspace 's' and put workspace 's' on the last monitor. This replaces the shift-and-follow as this is more powerful (shift and follow just puts the "shifted-to" workspace on the current monitor.) ofc if the two workspaces to swap are not visible, this just operates as a normal shift command. - Moved more dragging functionality to the Dragging.hs file and cleaned it up a little. More is certainly needed. - With the more powerful dragging functionality, many bindings are made redundant. I replaced one of these redundant bindings (button13 -> mouseWheel). This used to move the focused window around the stack, but this has been made redundant by the drag-to-swap functionality (button14 -> left-click-drag), so now it changes the master region size. --- src/Rahm/Desktop/Common.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Rahm/Desktop/Common.hs') diff --git a/src/Rahm/Desktop/Common.hs b/src/Rahm/Desktop/Common.hs index c3a6a31..5c29a1c 100644 --- a/src/Rahm/Desktop/Common.hs +++ b/src/Rahm/Desktop/Common.hs @@ -48,7 +48,6 @@ import qualified Rahm.Desktop.StackSet as S workspaces, ) import Text.Printf (printf) -import qualified XMonad as X import XMonad ( ScreenId, Window, @@ -69,6 +68,7 @@ import XMonad withFocused, withWindowSet, ) +import qualified XMonad as X import XMonad.Prompt (XPrompt (commandToComplete, showXPrompt)) import XMonad.Util.XUtils (pixelToString, stringToPixel) @@ -80,8 +80,8 @@ data Location = Location deriving (Read, Show, Eq, Ord) focusLocation :: Location -> X () -focusLocation (Location ws Nothing) = windows $ S.greedyView ws -focusLocation (Location _ (Just win)) = windows $ S.focusWindow win +focusLocation (Location ws mWin) = + windows $ maybe id S.focusWindow mWin . S.greedyView ws masterWindow :: MaybeT X Window masterWindow = MaybeT $ @@ -225,4 +225,3 @@ click = do (dpy, root) <- asks $ (,) <$> display <*> X.theRoot (_, _, window, _, _, _, _, _) <- io $ X.queryPointer dpy root focus window - -- cgit