Linux下鍵盤燈開啟和關閉的指令碼

xypincle發表於2017-03-09
將下面的指令碼儲存為 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部落格 ” ,連結:http://blog.itpub.net/28878983/viewspace-2134982/,如需轉載,請註明出處,否則將追究法律責任。

相關文章