awesome/my.lua
changeset 17 171cba5d3e3a
parent 15 73df43769340
child 18 f9712f62d202
--- a/awesome/my.lua	Sat Apr 16 12:28:11 2016 -0400
+++ b/awesome/my.lua	Sat Apr 16 13:41:51 2016 -0400
@@ -141,6 +141,21 @@
    return w
 end
 
+local function widgets_dio(devices)
+   local w = wibox.widget.textbox()
+   -- w:set_vertical(true)
+   w.width = 150
+   w:set_align('center')
+   local format = '<tt> '
+   for _, device in ipairs(devices) do
+      format = format .. device .. ': ${' .. device .. ' total_mb} '
+   end
+   format = format .. '</tt>'
+
+   vicious.register(w, vicious.widgets.dio, format, 1)
+   return w
+end
+
 local function widgets_mode()
    local bg = wibox.widget.background()
    local w = wibox.widget.textbox()
@@ -150,12 +165,6 @@
    return bg
 end
 
-local function widgets_keyboard()
-   local w = wibox.widget.textbox()
-   widgets.keyboard_widget = w
-   return w
-end
-
 local function widgets_decorated(w, onclick)
    local wg = w
    if w.widget then
@@ -170,9 +179,9 @@
    cpu = widgets_cpu,
    mem = widgets_mem,
    net = widgets_net,
+   dio = widgets_dio,
    mdp = widgets_mdp,
    mode = widgets_mode,
-   keyboard = widgets_keyboard,
    decorated = widgets_decorated,
 
 }