Brightness and volume keys don't work

So, I just got a new laptop, and I’m attempting to get it set up. However, my brightness and volume keys don’t work. In $HOME/.config/sway/config.d/default, there are the following lines:

# Volume
    #bindsym --locked XF86AudioRaiseVolume exec pamixer -ui 2
    bindsym --locked XF86AudioRaiseVolume exec notify-send test
    bindsym --locked XF86AudioLowerVolume exec pamixer -ud 2
    bindsym --locked XF86AudioMute exec pamixer -t


# Backlight
    #bindsym XF86MonBrightnessUp exec brightnessctl -c backlight set +5%
    bindsym XF86MonBrightnessUp exec notify-send test
    bindsym XF86MonBrightnessDown exec brightnessctl -c backlight set 5%-

Whenever I press the “Raise Volume” button with this configuration, it sends a notification. Whenever I press the “Raise Volume” button with the original (commented out) configuration, it does nothing.

On the other hand, it doesn’t do anything in either case when I press the brightness up button.

Any ideas on how I can fix this?

1 Like

As an update, it turns out that for my volume keys, pamixer wasn’t installed, so I switched it to pactl as follows:

bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle 

This was taken from this section of ArchWiki.

I am still having problems with the brightness keys, though.

I found something on ArchWiki that might be helpful (due to the fact that my laptop is a Lenovo), which says that the brightness keys (F5 and F6) might not work out of the box. I’ll keep looking into that and see what I can find.

Well, that link didn’t help a whole ton. I realized, though, that I could just set my own “brightness keys”. So I just set Mod+< to decrease the brightness and Mod+> to increase the brightness. That’ll have to suffice for now.

bindsym $mod+Shift+period exec brightnessctl -c backlight set +5%
bindsym $mod+Shift+comma exec brightnessctl -c backlight set 5%-

Just thought I’d post my solution for anyone else that has the same problem.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.