The basic way to do this is:
- Find out which (if any) key your ketboard volume keys send to the OS.
- Add a new bind for those volume keys to your bindings.conf file. For example this is the default volume up bind, but you could edit the input key to be something other than XF86AudioRaiseVolume:
binde = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
To find more about keybinds in Hyprland see here: https://wiki.hypr.land/Configuring/Binds/
The Hyprland page suggests using wev to find out which key is pressed: https://github.com/jwrdegoede/wev/blob/master/wev.1.scd
Steps to take to find what your keybaord is inputting:
- install wev form pacman
- Open a terminal and run
wev,
- select the wev window and use your volume keys, you should see something like this
wl_keyboard] key: serial: 40419; time: 8582088; key: 174; state: 1 (pressed) sym: XF86AudioStop (269025045), utf8: ''
- Note the bit that says
sym: ..... which indicates the key pressed, in this case it was XF86AudioStop
- Now edit the hyprland bindings.conf file to the use the key for the corrisponding voulme command.
Volume up:
binde = , [your_volume_up_key_here], exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
Volume down:
binde = , [your_volume_down_key_here], exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
Note: Using the above method will not trigger the volume icon to show, but it will change the volume. Maybe someone else know how to better solve it.