我最近买了一台 HP Pavilion 笔记本电脑,彻底摆脱了 Windows 的桎梏,安装了 Arch Linux。经过几个小时的工作,一切都很好——除了键盘背光。背光和指示静音的小 LED 不工作。你们当中的某个老手知道问题可能出在哪里吗?
这并没有真正造成阻碍,但我的自尊心告诉我要让这个东西运转起来。
编辑:找到https://wiki.archlinux.org/index.php/Keyboard_backlight按照说明操作后出现以下错误:
~/Test >>> python3 kb-light.py + 1
Traceback (most recent call last):
File "kb-light.py", line 26, in <module>
print(kb_light_set(int(sys.argv[2])))
File "kb-light.py", line 11, in kb_light_set
current = kbd_backlight.GetBrightness()
File "/usr/lib/python3.7/site-packages/dbus/proxies.py", line 70, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib/python3.7/site-packages/dbus/proxies.py", line 145, in __call__
**keywords)
File "/usr/lib/python3.7/site-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.UPower.KbdBacklight” on object at path /org/freedesktop/UPower/KbdBacklight
更新优力按照建议这里没有帮助。使用设定如上所述这里都不起作用。唯一的最新主题从四月份开始,有一个悲伤的人遇到了和我完全一样的问题;没有任何回复。
答案1
我编写了一个脚本来解决此问题:
#! /bin/bash
if [ $# -ne 1 ]
then
echo "Usage: bash $0 <on|off>"
echo " alternatively bash $0 <1|0> can be used as well"
else
if [[ $1 == 'on' ]] || [[ $1 == '1' ]]
then
sudo tee /sys/class/leds/tpacpi\:\:kbd_backlight/brightness <<< 3
elif [[ $1 == 'off' ]] || [[ $1 == '0' ]]
then
sudo tee /sys/class/leds/tpacpi\:\:kbd_backlight/brightness <<< 0
else
echo "Usage: bash $0 on|off"
fi
fi