awesome/my.lua
changeset 17 171cba5d3e3a
parent 15 73df43769340
child 18 f9712f62d202
equal deleted inserted replaced
16:b3c1a18fe12e 17:171cba5d3e3a
   139                     '<tt>${' .. device .. ' up} ▴ ${' .. device .. ' down} ▾</tt>',
   139                     '<tt>${' .. device .. ' up} ▴ ${' .. device .. ' down} ▾</tt>',
   140                    1)
   140                    1)
   141    return w
   141    return w
   142 end
   142 end
   143 
   143 
       
   144 local function widgets_dio(devices)
       
   145    local w = wibox.widget.textbox()
       
   146    -- w:set_vertical(true)
       
   147    w.width = 150
       
   148    w:set_align('center')
       
   149    local format = '<tt> '
       
   150    for _, device in ipairs(devices) do
       
   151       format = format .. device .. ': ${' .. device .. ' total_mb} '
       
   152    end
       
   153    format = format .. '</tt>'
       
   154 
       
   155    vicious.register(w, vicious.widgets.dio, format, 1)
       
   156    return w
       
   157 end
       
   158 
   144 local function widgets_mode()
   159 local function widgets_mode()
   145    local bg = wibox.widget.background()
   160    local bg = wibox.widget.background()
   146    local w = wibox.widget.textbox()
   161    local w = wibox.widget.textbox()
   147    bg:set_widget(w)
   162    bg:set_widget(w)
   148    widgets.mode_widget = w
   163    widgets.mode_widget = w
   149    widgets.mode_widget_bg = bg
   164    widgets.mode_widget_bg = bg
   150    return bg
   165    return bg
   151 end
   166 end
   152 
   167 
   153 local function widgets_keyboard()
       
   154    local w = wibox.widget.textbox()
       
   155    widgets.keyboard_widget = w
       
   156    return w
       
   157 end
       
   158 
       
   159 local function widgets_decorated(w, onclick)
   168 local function widgets_decorated(w, onclick)
   160    local wg = w
   169    local wg = w
   161    if w.widget then
   170    if w.widget then
   162       wg = w.widget
   171       wg = w.widget
   163    end
   172    end
   168 
   177 
   169 widgets = {
   178 widgets = {
   170    cpu = widgets_cpu,
   179    cpu = widgets_cpu,
   171    mem = widgets_mem,
   180    mem = widgets_mem,
   172    net = widgets_net,
   181    net = widgets_net,
       
   182    dio = widgets_dio,
   173    mdp = widgets_mdp,
   183    mdp = widgets_mdp,
   174    mode = widgets_mode,
   184    mode = widgets_mode,
   175    keyboard = widgets_keyboard,
       
   176    decorated = widgets_decorated,
   185    decorated = widgets_decorated,
   177 
   186 
   178 }
   187 }
   179 
   188 
   180 function split_modifiers(key)
   189 function split_modifiers(key)