diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2023-12-07 00:50:01 -0700 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2023-12-07 00:50:54 -0700 |
| commit | 87b103a4995fd2b6bbd1e72c446fd789caf5a050 (patch) | |
| tree | 91e54916d8ced30a62b6c75ea278a10ba3a52341 /src/Rahm/Desktop/StackSet.hs | |
| parent | 83543b4972edcebf3d9e568ed6a556ce074daa06 (diff) | |
| download | rde-87b103a4995fd2b6bbd1e72c446fd789caf5a050.tar.gz rde-87b103a4995fd2b6bbd1e72c446fd789caf5a050.tar.bz2 rde-87b103a4995fd2b6bbd1e72c446fd789caf5a050.zip | |
Experimental ability to pin a window using Mod+p
A pinned window will always try to stay on the same screen in the sname
position if it can.
Diffstat (limited to 'src/Rahm/Desktop/StackSet.hs')
| -rw-r--r-- | src/Rahm/Desktop/StackSet.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Rahm/Desktop/StackSet.hs b/src/Rahm/Desktop/StackSet.hs index 2dc8787..4ac00e4 100644 --- a/src/Rahm/Desktop/StackSet.hs +++ b/src/Rahm/Desktop/StackSet.hs @@ -2,6 +2,7 @@ module Rahm.Desktop.StackSet ( masterWindow, allVisibleWindows, differentiateWithFocus, + shiftWinNoFocus, concatMapTiledWindows, windowsOnWorkspace, findWorkspace, @@ -201,6 +202,13 @@ greedyView wid ss = switchWorkspaces (tag . workspace . current $ ss) wid ss shiftWin :: (Ord a, Eq s, Eq i) => i -> a -> StackSet i l a s sd -> StackSet i l a s sd shiftWin wid a = XMonad.StackSet.shiftWin wid a . fst . ensureWorkspace wid +shiftWinNoFocus :: (Ord a, Eq s, Eq i) => i -> a -> StackSet i l a s sd -> StackSet i l a s sd +shiftWinNoFocus n w s = case findTag w s of + Just from | n `tagMember` s && n /= from -> go from s + _ -> s + where go from = onWorkspace n (focusDown . insertUp w) . onWorkspace from (delete' w) + onWorkspace n f s = view (currentTag s) . f . view n $ s + windowsOnWorkspace :: (Eq i) => i -> StackSet i l a s sd -> [a] windowsOnWorkspace i ss = fromMaybe [] $ do ws <- find ((== i) . W.tag) (W.workspaces ss) |