setting up the media volume keys on the dwl wayland tiling window manager
using the mixer command to raise, lower and mute the volume
update you dont need to import the xf86 header, dwl already imports a version we can use
updated code
Code:
/* commands */
static const char *volumeup[] = { "/usr/sbin/mixer", "vol=+5%:+5%", NULL };
static const char *volumedown[] = { "/usr/sbin/mixer", "vol=-5%:-5%", NULL };
static const char *mutevolume[] = { "/usr/sbin/mixer", "vol.mute=^", NULL };
static const Key keys[] = {
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
/* modifier key function argument */
{ 0, XKB_KEY_XF86AudioRaiseVolume, spawn, {.v = volumeup } },
{ 0, XKB_KEY_XF86AudioLowerVolume, spawn, {.v = volumedown } },
{ 0, XKB_KEY_XF86AudioMute, spawn, {.v = mutevolume } },
github notes
cerberus/dwl/dwl-freebsd.org at master · NapoleonWils0n/cerberus
cerberus code library. Contribute to NapoleonWils0n/cerberus development by creating an account on GitHub.
dwl config files - just the modified files
cerberus/dwl/dwl-freebsd-config at master · NapoleonWils0n/cerberus
cerberus code library. Contribute to NapoleonWils0n/cerberus development by creating an account on GitHub.
volume control gist

dwm volume control with hardware multimedia keys (pipewire, pulseaudio, amixer and light as an extra)
dwm volume control with hardware multimedia keys (pipewire, pulseaudio, amixer and light as an extra) - dwm_config_pulseaudio.h
Last edited: