ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Linux下键盘灯开启和关闭的脚本

Linux下键盘灯开启和关闭的脚本

原创 Linux操作系统 作者:xypincle 时间:2017-03-09 10:32:32 0 删除 编辑
将下面的脚本存储为 sl 文件,并放置到 /etc/rc.d/init.d 目录下
  1. #!/bin/bash
  2. # chkconfig: 2345 80 10
  3. # description: sl
  4. if [ "$1" = "on" ] ||[ "$1" = "ON" ]; then
  5. xset led named 'Scroll Lock'
  6. elif [ "$1" = "off" ] ||[ "$1" = "OFF" ]; then
  7. xset -led named 'Scroll Lock'
  8. else
  9. echo "Usage: $0 on/off"
  10. exit 1
  11. fi
  12. exit 0
再将这个 sl 文件加入到 /etc/profile 文件里即可:

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28878983/viewspace-2134982/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-05-11

  • 博文量
    208
  • 访问量
    212338