Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- {{{ Wibox
- -- {{{ Widgets configuration
- --
- -- {{{ Reusable separators
- spacer = widget({ type = "textbox" })
- separator = widget({ type = "imagebox" })
- spacer.text = " "
- separator.image = image(beautiful.widget_sep)
- -- }}}
- -- {{{ CPU usage
- cpuicon = widget({ type = "imagebox" })
- cpuicon.image = image(beautiful.widget_cpu)
- -- Initialize widgets
- cpugraph = awful.widget.graph()
- -- Graph properties
- cpugraph:set_width(40)
- cpugraph:set_height(14)
- cpugraph:set_background_color(beautiful.fg_off_widget)
- cpugraph:set_gradient_angle(0)
- cpugraph:set_gradient_colors({ beautiful.fg_end_widget,
- beautiful.fg_center_widget, beautiful.fg_widget
- }) -- Register widgets
- vicious.register(cpugraph, vicious.widgets.cpu, "$1")
- -- }}}
- --{{{ Battery
- baticon = widget({ type = "imagebox" })
- baticon.image = image(beautiful.widget_bat)
- batwidget = widget({ type = "textbox" })
- -- Register widget
- vicious.register(batwidget, vicious.widgets.bat, "$2%", 61, "BAT0")
- function get_layout()
- local filedescriptor = io.popen("skb a")
- local value = filedescriptor:read()
- filedescriptor:close()
- return value
- end
- keylayout = widget({type = 'textbox', name="keylayout", align = 'right'})
- -- {{{ Memory usage
- memicon = widget({ type = "imagebox" })
- memicon.image = image(beautiful.widget_mem)
- -- Initialize widget
- membar = awful.widget.progressbar()
- -- Pogressbar properties
- membar:set_width(10)
- membar:set_height(12)
- membar:set_vertical(true)
- membar:set_background_color(beautiful.fg_off_widget)
- membar:set_border_color(beautiful.border_widget)
- membar:set_gradient_colors({ beautiful.fg_widget,
- beautiful.fg_center_widget, beautiful.fg_end_widget
- }) -- Register widget
- vicious.register(membar, vicious.widgets.mem, "$1", 13)
- -- }}}
- -- {{{ Volume level
- volicon = widget({ type = "imagebox" })
- volicon.image = image(beautiful.widget_vol)
- -- Initialize widgets
- volbar = awful.widget.progressbar()
- -- Progressbar properties
- volbar:set_width(10)
- volbar:set_height(12)
- volbar:set_vertical(true)
- volbar:set_background_color(beautiful.fg_off_widget)
- volbar:set_border_color(beautiful.border_widget)
- volbar:set_gradient_colors({ beautiful.fg_widget,
- beautiful.fg_center_widget, beautiful.fg_end_widget
- }) -- Enable caching
- -- Register widgets
- vicious.register(volbar, vicious.widgets.volume, "$1", 2, "PCM")
- -- }}}
- -- {{{ Date and time
- dateicon = widget({ type = "imagebox" })
- -- Initialize widget
- datewidget = widget({ type = "textbox" })
- -- Register widget
- vicious.register(datewidget, vicious.widgets.date, "%R", 61)
- -- }}}
- -- {{{ System tray
- systray = widget({ type = "systray" })
- -- }}}
- -- }}}
- -- {{{ Wibox initialisation
- wibox = {}
- promptbox = {}
- layoutbox = {}
- taglist = {}
- taglist.buttons = awful.util.table.join(
- awful.button({ }, 1, awful.tag.viewonly),
- awful.button({ modkey }, 1, awful.client.movetotag),
- awful.button({ }, 3, awful.tag.viewtoggle),
- awful.button({ modkey }, 3, awful.client.toggletag),
- awful.button({ }, 4, awful.tag.viewnext),
- awful.button({ }, 5, awful.tag.viewprev
- ))
- for s = 1, screen.count() do
- -- Create a promptbox
- promptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
- -- Create a layoutbox
- layoutbox[s] = awful.widget.layoutbox(s)
- layoutbox[s]:buttons(awful.util.table.join(
- awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
- awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
- awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
- awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)
- ))
- -- Create a taglist
- taglist[s] = awful.widget.taglist.new(s, awful.widget.taglist.label.all, taglist.buttons)
- -- Create the wibox
- wibox[s] = awful.wibox({ screen = s,
- fg = beautiful.fg_normal, height = 14,
- bg = beautiful.bg_normal, position = "top",
- border_color = beautiful.border_focus,
- border_width = beautiful.border_width
- })
- -- Add widgets to the wibox
- wibox[s].widgets = {
- { taglist[s], layoutbox[s], separator, promptbox[s],
- ["layout"] = awful.widget.layout.horizontal.leftright
- },
- s == screen.count() and systray or nil,
- separator, datewidget,
- separator, volbar.widget, volicon,
- separator, membar.widget, memicon,
- separator ,batwidget,baticon,
- separator, cpugraph.widget, cpuicon,
- separator, keylayout,
- separator, ["layout"] = awful.widget.layout.horizontal.rightleft
- }
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement