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

The following are examples of setting up keybindings with different programs to use i3-volume with your volume keys.

Table of Contents

i3wm

PulseAudio

Review the lines below and append to ~/.config/i3/config:

# Path to volume control, without trailing slash
set $volumepath ~/i3-volume

# Command for the status line
#   ie: i3blocks, i3status
set $statuscmd i3status

# Signal used to update the status line
#   i3blocks uses SIGRTMIN+10 by default
#   i3status uses SIGUSR1 by default
set $statussig SIGUSR1

# Using pulseaudio-utils (append "-s $sinkname" without quotes to override default sink)
bindsym XF86AudioRaiseVolume exec --no-startup-id $volumepath/volume -n -t $statuscmd -u $statussig up 5
bindsym XF86AudioLowerVolume exec --no-startup-id $volumepath/volume -n -t $statuscmd -u $statussig down 5
bindsym XF86AudioMute        exec --no-startup-id $volumepath/volume -n -t $statuscmd -u $statussig mute

amixer

Review the lines below and append to ~/.config/i3/config:

# Path to volume control, without trailing slash
set $volumepath ~/i3-volume

# Command for the status line
#   ie: i3blocks, i3status
set $statuscmd i3status

# Signal used to update the status line
#   i3blocks uses SIGRTMIN+10 by default
#   i3status uses SIGUSR1 by default
set $statussig SIGUSR1

bindsym XF86AudioRaiseVolume exec --no-startup-id $volumepath/volume -an -t $statuscmd -u $statussig up 5
bindsym XF86AudioLowerVolume exec --no-startup-id $volumepath/volume -an -t $statuscmd -u $statussig down 5
bindsym XF86AudioMute        exec --no-startup-id $volumepath/volume -an -t $statuscmd -u $statussig mute

sxkhd

The commands below do not update your statusbar such as i3status or i3blocks. To do that you have to append -t i3status -u SIGUSR1 or -t i3blocks -u SIGRTMIN+10 to the command.

Review the lines below and append to your ~/.config/sxkhd/sxkhdrc:

PulseAudio

XF86Audio{Mute,LowerVolume,RaiseVolume}
	~/i3-volume/volume -n {mute,down 5,up 5}

amixer

XF86Audio{Mute,LowerVolume,RaiseVolume}
	~/i3-volume/volume -an {mute,down 5,up 5}
Clone this wiki locally