diff --git a/rc/widgets.lua b/rc/widgets.lua index c1a8e07..c3daf9e 100644 --- a/rc/widgets.lua +++ b/rc/widgets.lua @@ -48,6 +48,33 @@ volwidget:buttons(awful.util.table.join( awful.button({ }, 5, function () awful.util.spawn("amixer -q -c 0 set Master 2dB-", false) end) )) +-- File systems +local fs = { ["/"] = "root", + ["/home"] = "home", + ["/var"] = "var", + ["/usr"] = "usr", + ["/tmp"] = "tmp", + ["/var/cache/build"] = "pbuilder" } +local fswidget = widget({ type = "textbox" }) +vicious.register(fswidget, vicious.widgets.fs, + function (widget, args) + local result = "" + for path, name in pairs(fs) do + local used = args["{" .. path .. " used_p}"] + local color = beautiful.fg_widget_value + if used then + if used > 90 then + color = beautiful.fg_widget_value_important + end + result = string.format( + '%s%s%s: ' .. + '%2d%%', + result, #result > 0 and separator.text or "", name, used) + end + end + return result + end, 10) + local systray = widget({ type = "systray" }) -- Wibox initialisation @@ -129,6 +156,7 @@ for s = 1, screen.count() do datewidget, separator, onsecond(volwidget), onsecond(separator), onsecond(batwidget), onsecond(batwidget and separator or nil), + onsecond(fswidget), onsecond(separator), onfirst(memwidget), onfirst(separator), onfirst(cpuwidget), onfirst(separator), tasklist[s], separator, diff --git a/themes/custom.lua b/themes/custom.lua index 3b9c163..a5d533c 100644 --- a/themes/custom.lua +++ b/themes/custom.lua @@ -12,6 +12,7 @@ if theme then theme.bg_widget = "#00000099" theme.fg_widget_label = "#708090" theme.fg_widget_value = "#FFFFFF" + theme.fg_widget_value_important = "#FF2222" theme.fg_widget_sep = "#FFFFFF" theme.fg_widget_border = "#FFFFFF" theme.fg_widget_clock = "#FF7F00"