Keyboard XF86Audio keys

I hope my query is acceptable for this forum. In Openbox, I have set up my keyboard to use the XF86Audio keys via .config/polybar/rc.xml, and they work just fine. In DWM I have done the same in the config.h as per the DWM advice and at first they work fine. However, after waking from a display/computer sleep they stop working. I won’t burden you with the code requirements because the code is obviously correct since everything works correctly at first and on restarting the computer.

I think I’ve found the solution. DWM doesn’t recognise the XF86audio keys on wake from sleep, so I rewrote the DWM config.h to use F9, F11, F12. If anyone knows how to get DWM to recognise the XF86audio keys after sleep, I would be grateful.

It looks like dwm doesn’t have built-in support so you’ll need to patch it in to config.h, e.g.:

1 Like

Thanks. I used the configuration you reference. I’ve just reinstalled my DWM and used palopez’s recommended config. I’ll see if it now works after waking from sleep.

Update: Everything looks good after a reboot, but the audio keys stop working after waking from sleep (the computer, not me!). I have experimented a lot and found the only solution is to use amixer set Master instead of pactl and to use the octal numbers for the keys instead of his XF86XK_AudioRaiseVolume etc.

1 Like