awesome-wm-widgets/volume-widget
Aurélien LAJOIE 5cda7b78b3 Volume, Add function for keys Binding
Add raise, lower and toggle function to the widget for key
bindings.

If notification is activated display the notification on raise, lower or
toggle
2020-03-30 22:06:46 +02:00
..
README.md Volume, Add function for keys Binding 2020-03-30 22:06:46 +02:00
audio-volume-muted-symbolic.png update readme for volume icon 2017-06-17 12:45:58 -04:00
audio-volume-muted-symbolic.svg update readme for volume icon 2017-06-09 16:10:57 -04:00
audio-volume-muted-symbolic_new.svg Created a new muted speaker icon 2018-10-17 22:40:08 -04:00
audio-volume-muted-symbolic_red.png update readme for volume icon 2017-06-17 12:45:58 -04:00
audio-volume-muted-symbolic_red.svg update readme for volume icon 2017-06-09 16:10:57 -04:00
vol-widget-1.png improve widget rendering and use wibox.widget wrapper 2017-02-03 22:15:16 -05:00
volume.lua Volume, Add function for keys Binding 2020-03-30 22:06:46 +02:00

README.md

Volume widget

Simple and easy-to-install widget for Awesome Window Manager which shows the sound level: Volume Widget

Note that widget uses the Arc icon theme, so it should be installed first under /usr/share/icons/Arc/ folder.

Customization

It is possible to customize widget by providing a table with all or some of the following config parameters:

Name Default Description
volume_audio_controller pulse audio device
display_notification false Display a notification on mouseover and keypress
notification_position top_right The notification position

Installation

  • clone/copy volume.lua file;

  • include volume.lua and add volume widget to your wibox in rc.lua:

local volume_widget = require("awesome-wm-widgets.volume-widget.volume")
...
        s.mytasklist, -- Middle widget
        { -- Right widgets
           ...
            volume_widget({display_notification = true}),
           ...

Control volume

To mute/unmute click on the widget. To increase/decrease volume scroll up or down when mouse cursor is over the widget.

If you want to control volume level by keyboard shortcuts add following lines in shortcut section of the rc.lua: IF you have notification activated, a notification will pop-up on key press

--  Key bindings
globalkeys = gears.table.join(
  awful.key(
    {},
    'XF86AudioRaiseVolume',
    volume_widget.raise,
    {description = 'volume up', group = 'hotkeys'}
  ),
  awful.key(
    {},
    'XF86AudioLowerVolume',
    volume_widget.lower,
    {description = 'volume down', group = 'hotkeys'}
  ),
  awful.key(
    {},
    'XF86AudioMute',
    volume_widget.toggle,
    {description = 'toggle mute', group = 'hotkeys'}
  ),

Icons

  • Optional step. In Arc icon theme the muted audio level icon (Volume-widget) looks like 0 level icon, which could be a bit misleading. So I decided to use original muted icon for low audio level, and the same icon, but colored in red for muted audio level. Fortunately icons are in svg format, so you can easily recolor them with sed, so it would look like this (Volume Widget):
cd /usr/share/icons/Arc/status/symbolic &&
sudo cp audio-volume-muted-symbolic.svg audio-volume-muted-symbolic_red.svg &&
sudo sed -i 's/bebebe/ed4737/g' ./audio-volume-muted-symbolic_red.svg

Pulse or ALSA only

Try running this command:

amixer -D pulse sget Master

If that prints something like this, then the default setting of 'pulse' is probably fine:

Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 64
  Mono: Playback 64 [100%] [0.00dB] [on]

If it prints something like this:

$ amixer -D pulse sget Master
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

amixer: Mixer attach pulse error: Connection refused

then set volume_audio_controller to alsa_only in widget constructor:

volume_widget({
    volume_audio_controller = 'alsa_only'
})