PulseAudio widgtet for the Awesome Window Manager that uses DBus
Go to file
Stefano Mazzucco fb8a6f4e5c Bump dependencies and conform to latest dbus_proxy API
Modify the callbacks used by connect_signal to take the actual argument from
the signal rather than an array containing the arguments. This breaking change
was introduced by dbus_proxy 0.9.0.
2017-11-11 17:59:57 +00:00
rockspec Bump dependencies and conform to latest dbus_proxy API 2017-11-11 17:59:57 +00:00
.gitignore Ignore *.rock files built by luarocks 2016-08-14 20:16:27 +01:00
LICENSE Initial commit and first public release: 0.1.0 2016-08-14 20:08:49 +01:00
README.md Add "Contributing" section to README 2017-07-16 13:05:16 +01:00
pulseaudio_widget.lua Bump dependencies and conform to latest dbus_proxy API 2017-11-11 17:59:57 +00:00

README.md

A widget for the Awesome Window Manager 4.x to control the volume

A widget for the Awesome Window Manager (version 4.x) that uses pulseaudio_dbus to control your audio devices.

Requirements

In addition to the requirements listed in the rockspec file, you will need the Awesome Window Manager version 4.x and PulseAudio with DBus enabled.

To enable DBus in PulseAudio, ensure that the line

load-module module-dbus-protocol

is present in /etc/pulse/default.pa or ~/.config/pulse/default.pa

Installation

The easiest way to install this widget is to use luarocks:

luarocks install pulseaudio_widget

You can use the --local option if you don't want or can't install it system-wide

This will ensure that all its dependencies are installed.

Note that if you install with --local you will have to make sure that the LUA_PATH environment variable includes the local luarocks path. This can be achieved by evaling the command luarocks path --bin before Awesome is started.

For example, if you start Awesome from the Linux console (e.g. xinit awesome) and you use zsh, you can add the following lines to your ~/.zprofile:

if (( $+commands[luarocks] )); then
    eval `luarocks path --bin`
fi

If you use bash, you can add the following lines to your ~/.bash_profile:

if [[ -n "`which luarocks 2>/dev/null`" ]]; then
    eval `luarocks path --bin`
fi

If you use an X Display Manager you will need to do what explained above in your ~/.xprofile or ~/.xinitrc. See the documentation of your display manager of choice for more information.

Configuration

The widget displays volume icons that are searched in the folder defined by beautiful.pulse_icon_theme with extension beautiful.pulse_icon_extension. The default is to look into "/usr/share/icons/Adwaita/scalable/status" for icons whose extension is ".svg".

Specifically, you will need icons named:

  • audio-volume-high-symbolic
  • audio-volume-medium-symbolic
  • audio-volume-low-symbolic
  • audio-volume-muted-symbolic

Mouse controls

When the widget is focused:

  • Scroll: controls the volume
  • Left button: toggles mute
  • Right button: launches mixer (mixer field of the widget table, defaults to pavucontrol)

Usage

Add the following to your ~/.config/awesome/rc.lua:

Require the module:

-- require *after* `beautiful.init` or the theme will be inconsistent!
local pulse = require("pulseaudio_widget")

Add the widget to your layout:

s.mywibox:setup {
  layout = wibox.layout.align.horizontal,
  { -- Left widgets },
  s.mytasklist, -- Middle widget
  { -- Right widgets
    pulse
  }
}

Finally add some keyboard shortcuts to control the volume:

awful.util.table.join(
  -- Audio
  awful.key({ }, "XF86AudioRaiseVolume", pulse.volume_up),
  awful.key({ }, "XF86AudioLowerVolume", pulse.volume_down),
  awful.key({ }, "XF86AudioMute",  pulse.toggle_muted),
  -- Microphone
  awful.key({"Shift"}, "XF86AudioRaiseVolume", pulse.volume_up_mic),
  awful.key({"Shift"}, "XF86AudioLowerVolume", pulse.volume_down_mic),
  awful.key({ }, "XF86MicMute",  pulse.toggle_muted_mic),
)

Contributing

This project is developed in the author's spare time. Contributions in the form of issues, patches and pull requests are welcome.

Credits

This program was inspired by the Awesome Pulseaudio Widget (APW).