当我在 ubuntu 20.04 上更改语言时,如何取消打开/关闭键盘灯?
我通过脚本配置了自定义开启和关闭
#!/bin/bash
if [ -f /tmp/keyboard_light ]; then
xset -led 3 && rm /tmp/keyboard_light
else
xset led 3 && touch /tmp/keyboard_light
fi
但是当我从托盘或“Super+Space”更改语言时键盘灯也改变了
答案1
1)gsettings get org.gnome.desktop.input-sources xkb-options
看['grp_led:scroll']
setxkbmap -layout 'us,ru' -option ''
- 关闭更改语言时的滚动指示器xmodmap -pm
看看
shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)
mod3 为空
xmodmap -e 'add mod3 = Scroll_Lock'
并且我的键盘灯处于打开状态,按下 Scroll Lock 按钮