Ubuntu next script about keyboard backlight on

Source: Internet
Author: User

First of all, I was in the process of learning Ubuntu system, found that my keyboard backlight can never open, (through scroll Lock);

So the Internet Baidu a method, through a script command to control the keyboard backlight, (first contact script)

1. First step open terminal Create a script file named led.sh directly with the VIM command (the default reader will vim)

Copy the script code in the following section

  1. #!/bin/bash-
  2. #===============================================================================
  3. #
  4. # FILE:ledctrl.sh
  5. #
  6. # USAGE:./ledctrl.sh
  7. #
  8. # DESCRIPTION:
  9. #
  10. # OPTIONS:---
  11. # REQUIREMENTS:---
  12. # BUGS:---
  13. # NOTES:---
  14. # Author:richard
  15. # ORGANIZATION:
  16. # created:2014-12-04 21:56:37 CST
  17. # REVISION:---
  18. #===============================================================================
  19. Status=/tmp/keyboard_led_status
  20. if [[${1} = = "on"] | | [[!-e ${status}]]; Then
  21. Xset led named ' Scroll Lock ' && echo "on" > ${status}
  22. Else
  23. Xset-led named ' Scroll Lock ' && rm-f ${status}
  24. Fi

2. Cannot be run immediately after creation, or you will find insufficient authority

chmod +x./led.sh  #使脚本具有执行权限./led.sh  #执行脚本
That's OK.


3. But it's stupid to run the script manually every time you turn on the backlight.
Enter the settings-"keyboard-" Shortcut-"custom shortcut keys, and then set the name and command, the command is the script file, my address below is not right, should be the script address you created
Then select it and set the shortcut key is usually scroll lock,



Ubuntu next script about keyboard backlight on

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.