linux下开启键盘背光

                                                                           返回主页

使用linux总有一个烦恼,在win下正常使用的键盘背光到了linux下就跪了.究其原因还是linux内核对键盘的支持不好.

默认在win下按下键"scroll"即可打开背光.

查找一些资料之后发现可以通过bash脚本实现对键盘背光的控制

代码如下

num - 0, caps - 0, scroll - 0 LED mask: 00000000

num - 0, caps - 1, scroll - 0 LED mask: 00001001

num - 1, caps - 0, scroll - 0 LED mask: 00000002

num - 1, caps - 1, scroll - 0 LED mask: 00001003

num - 0, caps - 0, scroll - 1 LED mask: 00000004

num - 0, caps - 1, scroll - 1 LED mask: 00001005

num - 1, caps - 0, scroll - 1 LED mask: 00000006

num - 1, caps - 1, scroll - 1 LED mask: 00001007

leds=xset q | grep LED | cut -c66 case $leds in 0 | 1 | 2 | 3 ) xset led 3 ;; 4 | 5 | 6 | 7 ) xset -led 3 ;; esac

保存为 name.sh之后(name为自定义),在命令行中输入 xset led 3, 键盘灯成功点亮.

希望有所帮助.