[XMonad] Add a binding to gather windows of the same class

This commit is contained in:
Ivan Malison 2017-09-09 20:27:48 -07:00
parent 8f248f7009
commit cf293d132f
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -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)