diff --git a/config.def.h b/config.def.h index c0fb983..b510e90 100644 --- a/config.def.h +++ b/config.def.h @@ -117,6 +117,8 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA #define SHWRAP(cmd) { "/bin/sh", "-c", cmd, NULL } #define TERMWRAP(cmd) { "foot", cmd, NULL } #define PLAYERCTL(cmd) { "playerctl", cmd, NULL } +#define WIREPLUMBERCTL(...) { "wpctl", __VA_ARGS__, NULL } +#define BRIGHTNESSCTL(cmd) { "brightnessctl", cmd, NULL } #define LOCKER "swaylock" /* commands */ @@ -159,10 +161,20 @@ static const Key keys[] = { { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_V, spawn, {.v = audiomixercmd} }, { MODKEY, XKB_KEY_y, spawn, {.v = passmancmd} }, - /* mpv controls */ - { 0, XKB_KEY_XF86AudioPlay, spawn, {.v = PLAYERCTL("play-pause")} }, - { 0, XKB_KEY_XF86AudioPrev, spawn, {.v = PLAYERCTL("previous")} }, - { 0, XKB_KEY_XF86AudioPlay, spawn, {.v = PLAYERCTL("next")} }, + /* media player */ + { 0, XKB_KEY_XF86AudioPlay, spawn, {.v = PLAYERCTL("play-pause")} }, + { 0, XKB_KEY_XF86AudioPrev, spawn, {.v = PLAYERCTL("previous")} }, + { 0, XKB_KEY_XF86AudioNext, spawn, {.v = PLAYERCTL("next")} }, + + /* sound server */ + { 0, XKB_KEY_XF86AudioMute, spawn, {.v = WIREPLUMBERCTL("set-mute", "@DEFAULT_AUDIO_SINK@", "toggle")} }, + { 0, XKB_KEY_XF86AudioMicMute, spawn, {.v = WIREPLUMBERCTL("set-mute", "@DEFAULT_AUDIO_SOURCE@", "toggle")} }, + { 0, XKB_KEY_XF86AudioRaiseVolume, spawn, {.v = WIREPLUMBERCTL("set-volume", "@DEFAULT_AUDIO_SINK@", "5%+")} }, + { 0, XKB_KEY_XF86AudioLowerVolume, spawn, {.v = WIREPLUMBERCTL("set-volume", "@DEFAULT_AUDIO_SINK@", "5%-")} }, + + /* misc */ + { 0, XKB_KEY_XF86MonBrightnessUp, spawn, {.v = BRIGHTNESSCTL("set", "5%+")} }, + { 0, XKB_KEY_XF86MonBrightnessDown,spawn, {.v = BRIGHTNESSCTL("set", "5%-")} }, /* window management */ { MODKEY, XKB_KEY_b, togglebar, {0} },