Simple question but hard answer, i searched around in Google a solution to make a dynamic widget to control and see the volume with Awesome Window manager but i can't find a working solution.
Any one got a solution to this ?
I simply followed the tutorial at http://awesome.naquadah.org/wiki/Volume_control_and_display and it worked. However, volume control was only via keyboard. Is this what you were looking for?
I should note that I'm on debian (testing) which I think uses awesome 3.4.
-- Update: After some testing out, I found http://awesome.naquadah.org/wiki/Farhavens_volume_widget, which has mouse controls (scroll mouse to control volume, and click to toggle mute). Following the tutorial works on my box.
amixer sset Master toggle
or amixer -d pulse set Master 1+ togglemute
both work to toggle mute.
io.popen("amixer -D pulse set Master 1+ togglemute"):read("*all")
(Mistake in the previous comment which I cannot edit anymore: should be amixer -D
not amixer -d
).
I'd like to mention following implementations just in case somebody is interested to have a volume control widget compatible with Awesome WM 4+:
From left to right:
All three widgets support mouse control: scroll up/down - increases/decreases volume, click - toggles mute.
If you have media keys you can use this
awful.key({}, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer -D pulse sset Master 2%+", false) end),
awful.key({}, "XF86AudioLowerVolume", function () awful.util.spawn("amixer -D pulse sset Master 2%-", false) end),
awful.key({}, "XF86AudioMute", function () awful.util.spawn("amixer -D pulse sset Master toggle", false) end),
in globalkeys in your rc.lua script
volumeicon worked out of the box for me. Note that this is not an AwesomeWM widget but a standalone project written in C. The advantage of this over the Awesome widgets are:
If you'd prefer a pure Lua Awesome widget, here is a list of available ones: