From 6b7e7e1c368e6d51b4f99e523ed89c07c08fd220 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 30 May 2017 19:24:04 -0700 Subject: [PATCH] [XMonad] Add gmail keybindings --- dotfiles/xmonad/xmonad.hs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index 1b58a03b..de7cd8c9 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -159,19 +159,24 @@ followingWindow action = do -- Selectors isHangoutsTitle = isPrefixOf "Google Hangouts" +isGmailTitle t = isInfixOf "@gmail.com" t && isInfixOf "Gmail" t isChromeClass = isInfixOf "chrome" chromeSelectorBase = isChromeClass <$> className -chromeSelector = chromeSelectorBase <&&> (not . isHangoutsTitle) <$> title +chromeSelector = + chromeSelectorBase <&&> + (\t -> not $ any ($ t) [isHangoutsTitle, isGmailTitle]) <$> title spotifySelector = className =? "Spotify" emacsSelector = className =? "Emacs" transmissionSelector = fmap (isPrefixOf "Transmission") title hangoutsSelector = chromeSelectorBase <&&> fmap isHangoutsTitle title +gmailSelector = chromeSelectorBase <&&> fmap isGmailTitle title volumeSelector = className =? "Pavucontrol" keepassSelector = className =? "keepassxc" virtualClasses = [ (hangoutsSelector, "Hangouts") + , (gmailSelector, "Gmail") , (chromeSelector, "Chrome") , (transmissionSelector, "Transmission") ] @@ -179,6 +184,7 @@ virtualClasses = -- Commands hangoutsCommand = "start_hangouts.sh" +gmailCommand = "start_chrome.sh --new-window https://mail.google.com/mail/u/0/#inbox" spotifyCommand = "spotify" chromeCommand = "google-chrome-unstable" emacsCommand = "emacsclient -c" @@ -209,11 +215,7 @@ myStartup = do myManageHook = composeOne - [ isFullscreen -?> doFullFloat - -- [transmissionSelector --> doShift "5"] - -- Hangouts being on a separate workspace freezes chrome - -- , [ hangoutsSelector --> doShift "2"] - ] + [ isFullscreen -?> doFullFloat ] -- Toggles @@ -750,8 +752,9 @@ addKeys conf@XConfig { modMask = modm } = -- Specific program spawning bindBringAndRaiseMany - [ (modalt, xK_e, spawn emacsCommand, emacsSelector) - , (modalt, xK_c, spawn chromeCommand, chromeSelector) + [ (modalt, xK_c, spawn chromeCommand, chromeSelector) + , (modalt, xK_e, spawn emacsCommand, emacsSelector) + , (modalt, xK_g, spawn gmailCommand, gmailSelector) , (modalt, xK_t, spawn transmissionCommand, transmissionSelector) ] ++