下面是我写的一个脚本。你可以把它加到你的环境变量里面去(比如说我放到了/usr/local/bin目录下)。用法为(假设你给这个脚本起的名字为sl):
开启背光灯:sl on 或者 sl ON
关闭背光等:sl off 或者 sl OFF
#!/bin/bash
if [ "$1" = "on" ] ||[ "$1" = "ON" ]; then
xset led named 'Scroll Lock'
elif [ "$1" = "off" ] ||[ "$1" = "OFF" ]; then
xset -led named 'Scroll Lock'
else
echo "Usage: $0 on/off"
exit 1
fi
exit 0