From cf293d132f090d931525d097f7dd46fea990a8ae Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 9 Sep 2017 20:27:48 -0700 Subject: [PATCH] [XMonad] Add a binding to gather windows of the same class --- dotfiles/xmonad/xmonad.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index 72db3599..d3cdb50e 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -727,6 +727,18 @@ myKill = else kill +-- Gather windows of same class + +allWindows = concat <$> (mapWorkspaces $ return . W.integrate' . W.stack) + +windowsMatchingClass klass = + allWindows >>= filterM (((== klass) <$>) . getClass) + +gatherClass klass = restoreFocus $ + windowsMatchingClass klass >>= mapM_ (windows . bringWindow) + +gatherThisClass = thisClass >>= flip whenJust gatherClass + -- Window switching -- Use greedyView to switch to the correct workspace, and then focus on the @@ -900,6 +912,7 @@ addKeys conf@XConfig { modMask = modm } = , ((modm .|. controlMask, xK_t), setReplaceTarget >> spawn "chromix-too open chrome://newtab") , ((modm .|. shiftMask, xK_c), myKill) + , ((hyper, xK_g), gatherThisClass) -- Directional navigation , ((modm, xK_w), windowGo U True)