1、使用终端创建文件夹:mkdir ~/bin
2、编辑脚本文件:vim ~/bin/ledctrl
3、copy以下代码:
> #!/bin/bash -
> #=================================================
> #
> # FILE: ledctrl
> #
> # USAGE: ./ledctrl
> #
> # DESCRIPTION:
> #
> # OPTIONS: ---
> # REQUIREMENTS: ---
> # BUGS: ---
> # NOTES: ---
> # AUTHOR: linkscue (scue), linkscue@gmail.com
> # ORGANIZATION:
> # CREATED: 2016年08月22日 14时10分55秒 CST
> # REVISION: ---
> #=================================================
>
> status=/tmp/keyboard_led_status if [[ ${1} == "on" ]] || [[ ! -e
> ${status} ]]; then
> xset led named 'Scroll Lock' && echo "on" > ${status} else
> xset -led named 'Scroll Lock' && rm -f ${status} fi
4、执行命令添加可执行权限:chmod a+x ~/bin/ledctrl
5、打开系统设置,键盘,快捷键,自定义,新建名称ledctrk,命令:./bin/ledctrl选择添加此项。按下键盘Scroll键,设置完成。