Volume sound and screen brightness controls not working
Solution 1
Multimedia Keys
First install these packages for brightness and volume:
sudo apt-get update; sudo apt-get install xbacklight alsa-utils pulseaudio
Then from I3 FAQ:
Add these lines to ~/.config/i3/config
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl -- set-sink-volume 0 +5% #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl -- set-sink-volume 0 -5% #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound
# Sreen brightness controls
bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness
Mod key
To change the $mod
key:
- Open
~/.config/i3/config
. -
Look for the line:
set $mod
-
Change that to:
set $mod Mod4
Finally, run
i3-msg reload
to reload the configuration file.
Solution 2
For volume, i used the command "amixer",
First, make sure you hava all the devices enabled, to see that first type
amixer
That should give tou the 'Master' state [on] or [off]
If it is [off], Set it to [on] by typing
amixer sset Master on
.
Now changing the default code of:
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 2 +5% #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 2 -5% #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle
to this one:
bindsym XF86AudioRaiseVolume exec amixer sset Master 5%+
bindsym XF86AudioLowerVolume exec amixer sset Master 5%-
bindsym XF86AudioMute exec amixer sset Master toggle
This command increase that percentage to all the output devices
Works perfect for me
Solution 3
xbacklight doesn't work for me. I wrote this script which writes directly into the kernel exposed back-light files, at least for intel:
https://github.com/jappeace/brightnessctl
I had to do a reinstall recently and just now made a makefile to make installation easier. This is just an alternative for if the xbacklight solution doesn't work for you either.
Solution 4
Well it's a variant of the same instructions as always, but for me I found light by haikarainen to work best over a variety of hardware:
So in your i3
config file, set:
bindsym XF86MonBrightnessDown exec light -U 10
bindsym XF86MonBrightnessUp exec light -A 10
Then simply reload with $mod+Shift+c
or i3-msg reload
or by directly restarting the WM.
Related videos on Youtube
Gabriel Sandoval
Updated on September 18, 2022Comments
-
Gabriel Sandoval over 1 year
Recently I have installed i3 windows manager.
The problem is that the footnote keys to control the volume and brightness don't work.
How can I solve this?
And how can I bind the mod key to the Win key?
-
quidproquo about 6 yearsif
xbacklight
doesn't work for you, see github.com/haikarainen/light
-
-
blkpws about 7 yearsWorks perfectly on Ubuntu 17.04!
-
Gabriel Ziegler almost 6 yearsI had to use
bindsym XF86AudioMute exec amixer -D set Master 1+ toggle
for toggling to work fine. -
Chitral Verma over 4 years+1 as xbacklight doesn't work out of the box with ubuntu 18.04
-
Dzintars almost 4 yearsI think it should be slightly modified if you have several sound cards.