#!/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
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
将上述文本放在/usr/local/bin/文件下,并给予文本可执行的权限。如此即可。
执行 sl on 即可开启键盘背光(前提是键盘要有背光功能)