Add gmail custom icon

This commit is contained in:
Ivan Malison 2017-05-30 18:23:13 -07:00
parent 7cf973df02
commit d79cfb4b1d
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
2 changed files with 12 additions and 10 deletions

View File

@ -109,16 +109,18 @@ main = do
(try $ getEnv "TAFFYBAR_MONITOR") :: IO (Either SomeException String)
interfaceNames <- getInterfaces
homeDirectory <- getHomeDirectory
let resourcesDirectory file =
homeDirectory </> ".lib" </> "resources" </> file
fallbackIcons _ klass
| "URxvt" `isInfixOf` klass =
IIFilePath $ resourcesDirectory "urxvt.png"
| "Termite" `isInfixOf` klass =
IIFilePath $ resourcesDirectory "urxvt.png"
| "Kodi" `isInfixOf` klass = IIFilePath $ resourcesDirectory "kodi.png"
| otherwise = IIColor (0xFF, 0xFF, 0, 0xFF)
myGetIconInfo = windowTitleClassIconGetter False fallbackIcons
let resourcesDirectory = homeDirectory </> ".lib" </> "resources"
inResourcesDirectory file = resourcesDirectory </> file
makeIcon = IIFilePath . inResourcesDirectory
myCustomIcon title klass
| "URxvt" `isInfixOf` klass = makeIcon "urxvt.png"
| "Termite" `isInfixOf` klass = makeIcon "urxvt.png"
| "Kodi" `isInfixOf` klass = makeIcon "kodi.png"
| "@gmail.com" `isInfixOf` title &&
"chrome" `isInfixOf` klass &&
"Gmail" `isInfixOf` title = makeIcon "gmail.png"
| otherwise = IINone
myGetIconInfo = windowTitleClassIconGetter True myCustomIcon
(monFilter, monNumber) =
case monEither of
Left _ -> (allMonitors, 0)

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB