在config.h中设置快捷方式后,pactl根本不起作用。但是,当我在终端中运行 pactl 时,它按预期工作
配置.h:
#include <X11/XF86keysym.h>
static const char *upvol[] = { "/usr/bin/pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%", NULL };
static const char *downvol[] = { "/usr/bin/pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%", NULL };
static const char *mutevol[] = { "/usr/bin/pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL };
static Key keys[] = {
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
{ 0, XF86XK_AudioMute, spawn, {.v = mutevol } },
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } }
};
即使我替换@DEFAULT_SINK@
为1
(这是我当前的接收器),它仍然不起作用
功能键起作用是因为 xev 检测到它们已分配事件:
KeymapNotify event, serial 37, synthetic NO, window 0x0,
keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
我通过 LightDM 会话使用 /usr/share/xsessions 中的 dwm.desktop 文件运行 DWM:
[Desktop Entry]
Encoding=UTF-8
Name=dwm
Comment=Dynamic window manager
Exec=dwm
Icon=dwm
Type=XSession
答案1
事实证明,在某些情况下必须完全重新安装 DWM 才能覆盖某些设置
sudo make uninstall && sudo make install