亮度和音量键绑定在 dwm 中不起作用

亮度和音量键绑定在 dwm 中不起作用

我正在尝试使用 dwm 让音量和亮度键正常工作。我将其放入 dwm/config.h 中:

static const char *upvol[] = {"/usr/bin/pactl", "set-sink-volume", "0", "+5%", NULL };
static const char *downvol[] = {"/usr/bin/pactl", "set-sink-volume", "0", "-5%", NULL };
static const char *mutevol[] = {"/usr/bin/pactl", "set-sink-mute", "0", "toggle", NULL };

static const char *brightnessup[] = {"sudo", "xbacklight", "-inc", "5", NULL };
static const char *brightnessdown[] = {"sudo", "xbacklight", "-dec", "5", NULL };

这也适用于静态 Key keys[] 中的按键绑定。

{ MODKEY,       XF86XK_AudioLowerVolume,  spawn, {.v = downvol} },
{ MODKEY        XF86XK_AudioRaiseVolume,  spawn, {.v = upvol} },
{ MODKEY,       XF86XK_AudioMute,         spawn, {.v = mutevol} },
{ MODKEY,       XF86XK_MonBrightnessUp,   spawn, {.v = brightnessup} },
{ MODKEY,       XF86XK_MonBrightnessDown, spawn  {.v = brightnessdown} },

到目前为止我已经在命令行中尝试过这个

sudo make uninstall
sudo make install

然后我尝试在 root 中执行相同的操作,但这并没有改变任何内容,我还杀死了 xsessions 并再次启动了所有内容,但它似乎仍然没有改变任何内容。

相关内容