|
|
@ -1,10 +1,13 @@
|
|
|
1
|
import Data.IORef (newIORef)
|
|
|
2
|
|
|
1
|
3
|
import System.Taffybar
|
|
2
|
|
import System.Taffybar.Battery
|
|
|
4
|
import System.Taffybar.Battery (textBatteryNew)
|
|
3
|
5
|
import System.Taffybar.Systray
|
|
4
|
6
|
import System.Taffybar.TaffyPager
|
|
5
|
7
|
import System.Taffybar.SimpleClock
|
|
6
|
8
|
import System.Taffybar.Widgets.PollingGraph
|
|
7
|
9
|
import System.Taffybar.Widgets.PollingLabel
|
|
|
10
|
import System.Information.Battery (batteryContextsNew)
|
|
8
|
11
|
import System.Information.CPU
|
|
9
|
12
|
import System.Information.Memory (parseMeminfo, memoryUsedRatio)
|
|
10
|
13
|
import Graphics.UI.Gtk (widgetShowAll)
|
|
|
@ -22,6 +25,8 @@ textMemoryNew intervalSeconds = do
|
|
22
|
25
|
return memLabel
|
|
23
|
26
|
|
|
24
|
27
|
main = do
|
|
|
28
|
cs <- batteryContextsNew
|
|
|
29
|
rs <- sequence $ fmap newIORef cs
|
|
25
|
30
|
let cpuCfg = defaultGraphConfig {
|
|
26
|
31
|
graphDataColors = [(0, 1, 0, 1), (1, 0, 1, 0.5)]
|
|
27
|
32
|
}
|
|
|
@ -29,7 +34,8 @@ main = do
|
|
29
|
34
|
log = taffyPagerNew defaultPagerConfig
|
|
30
|
35
|
tray = systrayNew
|
|
31
|
36
|
cpu = pollingGraphNew cpuCfg 3 cpuCallback
|
|
32
|
|
battery = textBatteryNew "Bat: $percentage$%" 30
|
|
|
37
|
battery = textBatteryNew rs "Bat: $percentage$%" 30
|
|
|
38
|
--battery = batteryBarNew defaultBatteryConfig 30
|
|
33
|
39
|
memory = textMemoryNew 3
|
|
34
|
40
|
defaultTaffybar defaultTaffybarConfig {
|
|
35
|
41
|
barHeight = 15,
|