Skip to content
Beau Hastings edited this page Oct 27, 2020 · 6 revisions

i3-volume can be used with xob (X Overlay Bar) to display volume notifications to the screen. While i3-volume already has support for libnotify compatible notification daemons, xob is not libnotify compatible and thus cannot be used with the -n option. However, we can use the -o option and send the volume to xob and get the same functionality.

To start, you'll need to create a named pipe:

mkfifo /tmp/xobpipe

Now lets configure i3wm.

Configure i3wm

In your ~/.config/i3/config append the following:

exec --no-startup-id tail -f /tmp/xobpipe | xob

Modify the i3-volume commands

The i3-volume commands in your ~/.config/i3/config need to be modified as well. Choose one of the options below depending on your setup:

PulseAudio

Based on the example PulseAudio configuration:

bindsym XF86AudioRaiseVolume exec --no-startup-id $volumepath/volume -t $statuscmd -u $statussig -o xob up $volumestep >> /tmp/xobpipe
bindsym XF86AudioLowerVolume exec --no-startup-id $volumepath/volume -t $statuscmd -u $statussig -o xob down $volumestep >> /tmp/xobpipe
bindsym XF86AudioMute        exec --no-startup-id $volumepath/volume -t $statuscmd -u $statussig -o xob mute >> /tmp/xobpipe

amixer

Based on the example amixer configuration:

bindsym XF86AudioRaiseVolume exec --no-startup-id $volumepath/volume -a -t $statuscmd -u $statussig -o xob up $volumestep >> /tmp/xobpipe
bindsym XF86AudioLowerVolume exec --no-startup-id $volumepath/volume -a -t $statuscmd -u $statussig -o xob down $volumestep >> /tmp/xobpipe
bindsym XF86AudioMute        exec --no-startup-id $volumepath/volume -a -t $statuscmd -u $statussig -o xob mute >> /tmp/xobpipe

Restart i3

It's important to note that exec will not be executed when i3wm is reloaded (such as with mod+Shift+r, so the tail command that we added will not run! You have to completely restart i3wm or try the temporary workaround below.

Unable to restart your i3wm session

If you don't want to or are unable to restart your i3wm session, as a temporary workaround you can replace exec with exec_always, like this: exec_always --no-startup-id tail -f /tmp/xobpipe | xob. Then reload with mod+Shift+r. After reloading you should change exec_always back to exec or else you will end up with several of these commands running in the background!