forked from colonelpanic/dotfiles
Add default taffybar config
This commit is contained in:
parent
d6ecadf101
commit
8a89798884
47
dotfiles/config/taffybar/taffybar.hs
Normal file
47
dotfiles/config/taffybar/taffybar.hs
Normal file
@ -0,0 +1,47 @@
|
||||
import System.Taffybar
|
||||
|
||||
import System.Taffybar.Systray
|
||||
import System.Taffybar.TaffyPager
|
||||
import System.Taffybar.SimpleClock
|
||||
import System.Taffybar.FreedesktopNotifications
|
||||
import System.Taffybar.Weather
|
||||
import System.Taffybar.MPRIS
|
||||
|
||||
import System.Taffybar.Widgets.PollingBar
|
||||
import System.Taffybar.Widgets.PollingGraph
|
||||
|
||||
import System.Information.Memory
|
||||
import System.Information.CPU
|
||||
|
||||
memCallback = do
|
||||
mi <- parseMeminfo
|
||||
return [memoryUsedRatio mi]
|
||||
|
||||
cpuCallback = do
|
||||
(userLoad, systemLoad, totalLoad) <- cpuLoad
|
||||
return [totalLoad, systemLoad]
|
||||
|
||||
main = do
|
||||
let memCfg = defaultGraphConfig { graphDataColors = [(1, 0, 0, 1)]
|
||||
, graphLabel = Just "mem"
|
||||
}
|
||||
cpuCfg = defaultGraphConfig { graphDataColors = [ (0, 1, 0, 1)
|
||||
, (1, 0, 1, 0.5)
|
||||
]
|
||||
, graphLabel = Just "cpu"
|
||||
}
|
||||
let clock = textClockNew Nothing "<span fgcolor='orange'>%a %b %_d %H:%M</span>" 1
|
||||
pager = taffyPagerNew defaultPagerConfig
|
||||
note = notifyAreaNew defaultNotificationConfig
|
||||
wea = weatherNew (defaultWeatherConfig "KMSN") 10
|
||||
mpris = mprisNew defaultMPRISConfig
|
||||
mem = pollingGraphNew memCfg 1 memCallback
|
||||
cpu = pollingGraphNew cpuCfg 0.5 cpuCallback
|
||||
tray = systrayNew
|
||||
defaultTaffybar defaultTaffybarConfig { startWidgets = [ pager, note ]
|
||||
, endWidgets = [ tray, wea, clock, mem, cpu, mpris ]
|
||||
}
|
||||
|
||||
-- Local Variables:
|
||||
-- flycheck-ghc-args: ("-Wno-missing-signatures")
|
||||
-- End:
|
Loading…
Reference in New Issue
Block a user