[XMonad] Add gmail keybindings

This commit is contained in:
Ivan Malison 2017-05-30 19:24:04 -07:00
parent 6748da99f7
commit 6b7e7e1c36
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -159,19 +159,24 @@ followingWindow action = do
-- Selectors -- Selectors
isHangoutsTitle = isPrefixOf "Google Hangouts" isHangoutsTitle = isPrefixOf "Google Hangouts"
isGmailTitle t = isInfixOf "@gmail.com" t && isInfixOf "Gmail" t
isChromeClass = isInfixOf "chrome" isChromeClass = isInfixOf "chrome"
chromeSelectorBase = isChromeClass <$> className chromeSelectorBase = isChromeClass <$> className
chromeSelector = chromeSelectorBase <&&> (not . isHangoutsTitle) <$> title chromeSelector =
chromeSelectorBase <&&>
(\t -> not $ any ($ t) [isHangoutsTitle, isGmailTitle]) <$> title
spotifySelector = className =? "Spotify" spotifySelector = className =? "Spotify"
emacsSelector = className =? "Emacs" emacsSelector = className =? "Emacs"
transmissionSelector = fmap (isPrefixOf "Transmission") title transmissionSelector = fmap (isPrefixOf "Transmission") title
hangoutsSelector = chromeSelectorBase <&&> fmap isHangoutsTitle title hangoutsSelector = chromeSelectorBase <&&> fmap isHangoutsTitle title
gmailSelector = chromeSelectorBase <&&> fmap isGmailTitle title
volumeSelector = className =? "Pavucontrol" volumeSelector = className =? "Pavucontrol"
keepassSelector = className =? "keepassxc" keepassSelector = className =? "keepassxc"
virtualClasses = virtualClasses =
[ (hangoutsSelector, "Hangouts") [ (hangoutsSelector, "Hangouts")
, (gmailSelector, "Gmail")
, (chromeSelector, "Chrome") , (chromeSelector, "Chrome")
, (transmissionSelector, "Transmission") , (transmissionSelector, "Transmission")
] ]
@ -179,6 +184,7 @@ virtualClasses =
-- Commands -- Commands
hangoutsCommand = "start_hangouts.sh" hangoutsCommand = "start_hangouts.sh"
gmailCommand = "start_chrome.sh --new-window https://mail.google.com/mail/u/0/#inbox"
spotifyCommand = "spotify" spotifyCommand = "spotify"
chromeCommand = "google-chrome-unstable" chromeCommand = "google-chrome-unstable"
emacsCommand = "emacsclient -c" emacsCommand = "emacsclient -c"
@ -209,11 +215,7 @@ myStartup = do
myManageHook = myManageHook =
composeOne composeOne
[ isFullscreen -?> doFullFloat [ isFullscreen -?> doFullFloat ]
-- [transmissionSelector --> doShift "5"]
-- Hangouts being on a separate workspace freezes chrome
-- , [ hangoutsSelector --> doShift "2"]
]
-- Toggles -- Toggles
@ -750,8 +752,9 @@ addKeys conf@XConfig { modMask = modm } =
-- Specific program spawning -- Specific program spawning
bindBringAndRaiseMany 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) , (modalt, xK_t, spawn transmissionCommand, transmissionSelector)
] ++ ] ++