Gratuit's volume widget

Simple volume widget written for Awesome 3.4.10 using the Vicious library 2.0.3. You can place this in your rc.lua. You will need to customize to your preferences(i.e. colors and size and frequency of updating)

--Create Volume Progressbar -- Initialize widget volwidget = awful.widget.progressbar -- Progressbar properties volwidget:set_width(8) volwidget:set_height(22) volwidget:set_vertical(true) volwidget:set_background_color("#232323") volwidget:set_border_color(nil) volwidget:set_color("#606060") volwidget:set_gradient_colors({ "#606060", "blue" }) --Register widget vicious.register(volwidget, vicious.widgets.volume, "$1", 0.2, "Master") --Mouse bindings volwidget.widget:buttons(awful.util.table.join( awful.button({ }, 4, function awful.util.spawn_with_shell("amixer -c 0 set Master 1+ unmute") end), awful.button({ }, 5, function awful.util.spawn_with_shell("amixer -c 0 set Master 1-") end) ))

If you want a box to appear around the widget when muted, then change the register widget line to:

--Register widget vicious.register(volwidget, vicious.widgets.volume,           function(widget, args)                if args[2] == "♩" then                    volwidget:set_border_color("#990000")                else                    volwidget:set_border_color(nil)                end                return args[1]            end           , 0.2, "Master")

Then place it in your wiibox:

Find the section that looks like this and add the line indicated: mywibox[s].widgets = { {           mylauncher, mytaglist[s], mypromptbox[s], layout = awful.widget.layout.horizontal.leftright },       mylayoutbox[s], mytextclock, volwidget.widget,                                  --Add this line. s == 1 and mysystray or nil, mytasklist[s], layout = awful.widget.layout.horizontal.rightleft } If 'Master' dosn't work for you try this(also Mute/Unmute with left click): --Register widget vicious.register(volwidget, vicious.widgets.volume, "$1", 0.2, 'PCM') --Mouse bindings volwidget.widget:buttons(awful.util.table.join( awful.button({ }, 4, function awful.util.spawn_with_shell("amixer -c 0 set PCM 2+ unmute > /dev/null") end), awful.button({ }, 5, function awful.util.spawn_with_shell("amixer -c 0 set PCM 2- > /dev/null") end), awful.button({ }, 1, function awful.util.spawn_with_shell("amixer set 'Master Front' `amixer get 'Master Front' | grep off > /dev/null && echo un`mute") end) ))