forked from colonelpanic/dotfiles
[taffybar] Add fallback icon for urxvt
This commit is contained in:
parent
cc8e45b128
commit
dfc591c532
@ -1,6 +1,9 @@
|
|||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import qualified Data.Word8 as W
|
import Data.Char (toLower)
|
||||||
|
import Data.List
|
||||||
|
import System.Directory
|
||||||
|
import System.FilePath.Posix
|
||||||
import System.Information.CPU
|
import System.Information.CPU
|
||||||
import System.Information.Memory
|
import System.Information.Memory
|
||||||
import System.Taffybar
|
import System.Taffybar
|
||||||
@ -21,14 +24,14 @@ cpuCallback = do
|
|||||||
(_, systemLoad, totalLoad) <- cpuLoad
|
(_, systemLoad, totalLoad) <- cpuLoad
|
||||||
return [totalLoad, systemLoad]
|
return [totalLoad, systemLoad]
|
||||||
|
|
||||||
zero :: W.Word8
|
resourcesDirectory file = ("/home" </> "imalison" </> ".lib" </> "resources" </> file)
|
||||||
zero = fromIntegral 0
|
|
||||||
|
|
||||||
alwaysTransparent _ _ =
|
fallbackIcons _ klass
|
||||||
IIColor $ (fromIntegral 0xFF, fromIntegral 0, zero, fromIntegral 0xFF)
|
| isInfixOf "URxvt" klass = IIFilePath $ resourcesDirectory "urxvt.png"
|
||||||
|
| otherwise = IIColor $ (0xFF, 0xFF, 0, 0xFF)
|
||||||
|
|
||||||
myGetIconInfo =
|
myGetIconInfo =
|
||||||
windowTitleClassIconGetter False alwaysTransparent
|
windowTitleClassIconGetter False fallbackIcons
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
let memCfg = defaultGraphConfig { graphDataColors = [(1, 0, 0, 1)]
|
let memCfg = defaultGraphConfig { graphDataColors = [(1, 0, 0, 1)]
|
||||||
@ -49,6 +52,7 @@ main = do
|
|||||||
, minWSWidgetSize = Nothing
|
, minWSWidgetSize = Nothing
|
||||||
, minIcons = 3
|
, minIcons = 3
|
||||||
, getIconInfo = myGetIconInfo
|
, getIconInfo = myGetIconInfo
|
||||||
|
, windowIconSize = 32
|
||||||
, updateIconsOnTitleChange = False
|
, updateIconsOnTitleChange = False
|
||||||
, widgetBuilder = buildBorderButtonController
|
, widgetBuilder = buildBorderButtonController
|
||||||
-- , showWorkspaceFn = hideEmpty
|
-- , showWorkspaceFn = hideEmpty
|
||||||
@ -60,7 +64,7 @@ main = do
|
|||||||
, endWidgets = [ tray, clock, mem, cpu, mpris ]
|
, endWidgets = [ tray, clock, mem, cpu, mpris ]
|
||||||
, monitorNumber = 1
|
, monitorNumber = 1
|
||||||
, barPosition = Top
|
, barPosition = Top
|
||||||
, barHeight = 30
|
, barHeight = 40
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Local Variables:
|
-- Local Variables:
|
||||||
|
BIN
dotfiles/lib/resources/urxvt.png
Normal file
BIN
dotfiles/lib/resources/urxvt.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 144 KiB |
Loading…
Reference in New Issue
Block a user