From fed2941ec5c87eea399dbe15708710bee8453947 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 21 Nov 2016 23:46:16 -0600 Subject: [PATCH] [XMonad] Use named scratchpads for hangouts, spotify and htop --- dotfiles/xmonad/xmonad.hs | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index 549b7d37..b7b0ea94 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -45,6 +45,7 @@ import XMonad.Util.CustomKeys import qualified XMonad.Util.Dmenu as DM import qualified XMonad.Util.ExtensibleState as XS import XMonad.Util.Minimize +import XMonad.Util.NamedScratchpad (NamedScratchpad(NS), nonFloating, namedScratchpadAction) import XMonad.Util.NamedWindows (getName) main = xmonad $ def @@ -364,6 +365,14 @@ swapMinimizeStateAfter action = withFocused $ \originalWindow -> do when (newWindow /= originalWindow) $ minimizeWindow originalWindow +-- Named Scratchpads +scratchpads = [ NS "htop" htopCommnad (title =? "htop") nonFloating + , NS "spotify" spotifyCommand spotifySelector nonFloating + , NS "hangouts" hangoutsCommand hangoutsSelector nonFloating + ] + +doScratchpad = deactivateFullAnd . namedScratchpadAction scratchpads + -- Raise or spawn myRaiseNextMaybe = (maybeUnminimizeClassAfter .) . raiseNextMaybeCustomFocus greedyFocusWindow @@ -421,6 +430,16 @@ addKeys conf@XConfig {modMask = modm} = , ((modalt, xK_5), selectToggle) , ((modalt, xK_4), selectLimit) + -- ScratchPads + , ((modalt, xK_m), doScratchpad "htop") + , ((modalt, xK_s), doScratchpad "spotify") + , ((modalt, xK_h), doScratchpad "hangouts") + + , ((modalt .|. controlMask, xK_h), + myRaiseNextMaybe (spawn hangoutsCommand) hangoutsSelector) + , ((modalt .|. controlMask, xK_s), + myRaiseNextMaybe (spawn spotifyCommand) spotifySelector) + -- playerctl , ((mod3Mask, xK_f), spawn "playerctl play-pause") , ((0, xF86XK_AudioPause), spawn "playerctl play-pause") @@ -440,8 +459,8 @@ addKeys conf@XConfig {modMask = modm} = [ (modalt, xK_e, spawn emacsCommand, emacsSelector) , (modalt, xK_c, spawn chromeCommand, chromeSelector) - , (modalt, xK_s, spawn spotifyCommand, spotifySelector) - , (modalt, xK_h, spawn hangoutsCommand, hangoutsSelector) + -- , (modalt, xK_s, spawn spotifyCommand, spotifySelector) + -- , (modalt, xK_h, spawn hangoutsCommand, hangoutsSelector) , (modalt, xK_t, spawn transmissionCommand, transmissionSelector) ] ++ -- Replace original moving stuff around + greedy view bindings