awful.key 中的电源按钮

Power Button in awful.key

如何为笔记本电脑上的电源按钮设置动作?我尝试使用 awful.key({ }, "Power",... 但它不起作用。

在终端中尝试 运行 xev 并查看它对按键的说明。例如,我的键盘上有一个计算器键,它似乎是 XF86Calculator:

KeyRelease event, serial 37, synthetic NO, window 0x2400001,
    root 0x761, subw 0x0, time 179605294, (572,728), root:(2493,769),
    state 0x10, keycode 148 (keysym 0x1008ff1d, XF86Calculator), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

以下是关于密钥名称的一些随机猜测:

$ grep -r Power /usr/include/X11 
/usr/include/X11/Xtrans/Xtranslcl.c: *  Pittsburgh Powercomputing Corporation (PPc)/Quarterdeck Office Systems
/usr/include/X11/XF86keysym.h:#define XF86XK_PowerDown  0x1008FF21   /* Deep sleep the system      */
/usr/include/X11/XF86keysym.h:#define XF86XK_PowerOff       0x1008FF2A   /* Power off system entirely  */
/usr/include/X11/Sunkeysym.h:#define SunXK_PowerSwitch      0x1005FF76
/usr/include/X11/Sunkeysym.h:#define SunXK_PowerSwitchShift     0x1005FF7D