[taffybar] Add battery display

This commit is contained in:
Ivan Malison 2016-11-14 05:49:12 -06:00
parent 1320c59a6c
commit 2341457723
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -1,6 +1,7 @@
import System.Taffybar
import System.Taffybar.Systray
import System.Taffybar.Battery
import System.Taffybar.TaffyPager
import System.Taffybar.SimpleClock
import System.Taffybar.MPRIS2
@ -27,14 +28,16 @@ main = do
]
, graphLabel = Just "cpu"
}
batteryCfg = defaultBatteryConfig
let clock = textClockNew Nothing "<span fgcolor='orange'>%a %b %_d %r</span>" 1
pager = taffyPagerNew defaultPagerConfig
mpris = mpris2New
mem = pollingGraphNew memCfg 1 memCallback
cpu = pollingGraphNew cpuCfg 0.5 cpuCallback
tray = systrayNew
battery = batteryBarNew batteryCfg 30
defaultTaffybar defaultTaffybarConfig { startWidgets = [ pager ]
, endWidgets = [ tray, clock, mem, cpu, mpris ]
, endWidgets = [ battery, tray, clock, mem, cpu, mpris ]
, monitorNumber = 1
}