-
-
Save fujin/8409962 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Taffybar | |
import System.Taffybar.Systray | |
import System.Taffybar.XMonadLog | |
import System.Taffybar.SimpleClock | |
import System.Taffybar.FreedesktopNotifications | |
import System.Taffybar.DiskIOMonitor | |
import System.Taffybar.CPUMonitor | |
import System.Taffybar.FSMonitor | |
import System.Taffybar.NetMonitor | |
import System.Taffybar.MPRIS | |
import System.Taffybar.Widgets.PollingBar | |
import System.Taffybar.Widgets.PollingGraph | |
import System.Information.Memory | |
import System.Information.CPU | |
import Data.Time.LocalTime | |
memCallback = do | |
mi <- parseMeminfo | |
return [memoryUsedRatio mi] | |
main = do | |
let memCfg = defaultGraphConfig { graphDataColors = [ (1, 0, 0, 1)] | |
, graphLabel = Just "mem" | |
} | |
let cpuCfg = defaultGraphConfig { graphDataColors = [ (0, 1, 0, 1) | |
, (1, 0, 1, 0.5) ] | |
, graphLabel = Just "cpu" | |
} | |
let diskCfg = defaultGraphConfig { graphDataColors = [ (0, 1, 0, 1), | |
(1, 0, 1, 0.5) ] | |
, graphLabel = Just "disk i/o" | |
} | |
log = xmonadLogNew | |
note = notifyAreaNew defaultNotificationConfig | |
mpris = mprisNew | |
mem = pollingGraphNew memCfg 1 memCallback | |
cpu = cpuMonitorNew cpuCfg 0.5 "cpu" | |
fs = fsMonitorNew 30 ["/"] | |
disk = dioMonitorNew diskCfg 1 "sdb" | |
net = netMonitorNew 1 "enp15s0" | |
tray = systrayNew | |
defaultTaffybar defaultTaffybarConfig { startWidgets = [ log, note ] | |
, endWidgets = [ tray, fs, net, disk, mem, cpu, mpris ] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment