-
Notifications
You must be signed in to change notification settings - Fork 36
Usage with xob
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.
In your ~/.config/i3/config
append the following:
exec --no-startup-id tail -f /tmp/xobpipe | xob
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:
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
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
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.
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!