This is a very simple module with lua language that controls volume in Awesome window manager.
I created and used this modeule on Arch Linux.
- Clone your project inside ~/.config/awesome (i.e. in the same directory with rc.lua)
cd ~/.config/awesome
git clone https://github.com/IbrahimElsayed26498/volume-control
- Inside rc.lua In the beginning of the file write:
local volume = require("volume-control.volume")
- Inside (Right Widget) area call volume.getwidget
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
mylauncher,
s.mytaglist,
s.mypromptbox,
},
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
volume.getwidget(), -- Add this line here
mykeyboardlayout,
mytextclock,
-- s.mylayoutbox,
},
}
After previous steps, you have the volume value in you title bar.
- Let's make the keys works to make the volume up, down and mute/unmute
We are still inside rc.lua
In key binding area add.
-- Volume
awful.key({}, "XF86AudioRaiseVolume", function() volume.up() end,
{description = "volume up", group = "volume"}),
awful.key({}, "XF86AudioLowerVolume", function() volume.down() end,
{description = "volume down", group = "volume"}),
awful.key({}, "XF86AudioMute", function() volume.toggle() end,
{descriptoin = "mute / unmute", group = "volume"})
Now save the file and reload awesome window manager.
- Now it supports to control external devices.