Advertisement
Guest User

kelmiir

a guest
Jun 29th, 2011
628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.62 KB | None | 0 0
  1. -- {{{ Wibox
  2. -- {{{ Widgets configuration
  3. --
  4. -- {{{ Reusable separators
  5. spacer    = widget({ type = "textbox"  })
  6. separator = widget({ type = "imagebox" })
  7. spacer.text     = " "
  8. separator.image = image(beautiful.widget_sep)
  9. -- }}}
  10.  
  11. -- {{{ CPU usage
  12. cpuicon = widget({ type = "imagebox" })
  13. cpuicon.image = image(beautiful.widget_cpu)
  14. -- Initialize widgets
  15. cpugraph  = awful.widget.graph()
  16. -- Graph properties
  17. cpugraph:set_width(40)
  18. cpugraph:set_height(14)
  19. cpugraph:set_background_color(beautiful.fg_off_widget)
  20. cpugraph:set_gradient_angle(0)
  21. cpugraph:set_gradient_colors({ beautiful.fg_end_widget,
  22.    beautiful.fg_center_widget, beautiful.fg_widget
  23. }) -- Register widgets
  24. vicious.register(cpugraph, vicious.widgets.cpu, "$1")
  25. -- }}}
  26. --{{{ Battery
  27. baticon = widget({ type = "imagebox" })
  28. baticon.image = image(beautiful.widget_bat)
  29. batwidget = widget({ type = "textbox" })
  30. -- Register widget
  31. vicious.register(batwidget, vicious.widgets.bat, "$2%", 61, "BAT0")
  32.  
  33. function get_layout()
  34.     local filedescriptor = io.popen("skb a")
  35.         local value = filedescriptor:read()
  36.             filedescriptor:close()
  37.                 return value
  38.                 end
  39. keylayout = widget({type = 'textbox', name="keylayout", align = 'right'})
  40.  
  41. -- {{{ Memory usage
  42. memicon = widget({ type = "imagebox" })
  43. memicon.image = image(beautiful.widget_mem)
  44. -- Initialize widget
  45. membar = awful.widget.progressbar()
  46. -- Pogressbar properties
  47. membar:set_width(10)
  48. membar:set_height(12)
  49. membar:set_vertical(true)
  50. membar:set_background_color(beautiful.fg_off_widget)
  51. membar:set_border_color(beautiful.border_widget)
  52. membar:set_gradient_colors({ beautiful.fg_widget,
  53.    beautiful.fg_center_widget, beautiful.fg_end_widget
  54. }) -- Register widget
  55. vicious.register(membar, vicious.widgets.mem, "$1", 13)
  56. -- }}}
  57.  
  58. -- {{{ Volume level
  59. volicon = widget({ type = "imagebox" })
  60. volicon.image = image(beautiful.widget_vol)
  61. -- Initialize widgets
  62. volbar = awful.widget.progressbar()
  63. -- Progressbar properties
  64. volbar:set_width(10)
  65. volbar:set_height(12)
  66. volbar:set_vertical(true)
  67. volbar:set_background_color(beautiful.fg_off_widget)
  68. volbar:set_border_color(beautiful.border_widget)
  69. volbar:set_gradient_colors({ beautiful.fg_widget,
  70.    beautiful.fg_center_widget, beautiful.fg_end_widget
  71. }) -- Enable caching
  72. -- Register widgets
  73. vicious.register(volbar, vicious.widgets.volume, "$1",  2, "PCM")
  74. -- }}}
  75.  
  76. -- {{{ Date and time
  77. dateicon = widget({ type = "imagebox" })
  78. -- Initialize widget
  79. datewidget = widget({ type = "textbox" })
  80. -- Register widget
  81. vicious.register(datewidget, vicious.widgets.date, "%R", 61)
  82. -- }}}
  83.  
  84. -- {{{ System tray
  85. systray = widget({ type = "systray" })
  86. -- }}}
  87. -- }}}
  88.  
  89. -- {{{ Wibox initialisation
  90. wibox     = {}
  91. promptbox = {}
  92. layoutbox = {}
  93. taglist   = {}
  94. taglist.buttons = awful.util.table.join(
  95.     awful.button({ }, 1, awful.tag.viewonly),
  96.     awful.button({ modkey }, 1, awful.client.movetotag),
  97.     awful.button({ }, 3, awful.tag.viewtoggle),
  98.     awful.button({ modkey }, 3, awful.client.toggletag),
  99.     awful.button({ }, 4, awful.tag.viewnext),
  100.     awful.button({ }, 5, awful.tag.viewprev
  101. ))
  102. for s = 1, screen.count() do
  103.     -- Create a promptbox
  104.     promptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
  105.     -- Create a layoutbox
  106.     layoutbox[s] = awful.widget.layoutbox(s)
  107.     layoutbox[s]:buttons(awful.util.table.join(
  108.         awful.button({ }, 1, function () awful.layout.inc(layouts, 1)  end),
  109.         awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
  110.         awful.button({ }, 4, function () awful.layout.inc(layouts, 1)  end),
  111.         awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)
  112.     ))
  113.     -- Create a taglist
  114.     taglist[s] = awful.widget.taglist.new(s, awful.widget.taglist.label.all, taglist.buttons)
  115.     -- Create the wibox
  116.     wibox[s] = awful.wibox({      screen = s,
  117.         fg = beautiful.fg_normal, height = 14,
  118.         bg = beautiful.bg_normal, position = "top",
  119.         border_color = beautiful.border_focus,
  120.         border_width = beautiful.border_width
  121.     })
  122.     -- Add widgets to the wibox
  123.     wibox[s].widgets = {
  124.         {   taglist[s], layoutbox[s], separator, promptbox[s],
  125.             ["layout"] = awful.widget.layout.horizontal.leftright
  126.         },
  127.         s == screen.count() and systray or nil,
  128.         separator, datewidget,
  129.         separator, volbar.widget, volicon,
  130.         separator, membar.widget, memicon,
  131.         separator ,batwidget,baticon,
  132.         separator, cpugraph.widget, cpuicon,
  133.         separator, keylayout,
  134.         separator, ["layout"] = awful.widget.layout.horizontal.rightleft
  135.     }
  136. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement