A script allows your Ubuntu14.04 to remember the screen brightness

Source: Internet
Author: User
My computer is Lenovo y400, whether it is 32-bit Ubuntu or 64-bit Ubuntu, whether it is 13.04 or the current 14.04 developer version, I cannot make my little y realize the simple action of memorizing the screen brightness, and I cannot use the Fn + left and right keys to adjust the brightness. Various online solutions seem to be ineffective for my computer, later, we found that the xbacklight tool can be used to adjust the screen brightness. Another article: Let Ubuntu14.04 & ldquo; Save & rdquo; screen

My computer is Lenovo y400, whether it is 32-bit Ubuntu or 64-bit Ubuntu, whether it is 13.04 or the current 14.04 developer version, I cannot make my little y realize the simple action of memorizing the screen brightness, and I cannot use the Fn + left and right keys to adjust the brightness. Various online solutions seem to be ineffective for my computer, later, we found that the xbacklight tool can be used to adjust the screen brightness.

Another article: Let Ubuntu 14.04 "save" the screen brightness value http://www.linuxidc.com/Linux/2014-09/106846.htm

Hardware information:

# Lspci | grep VGA 0:00. 0 VGA compatible controller: NVIDIA Corporation gk0000m [GeForce GT 650 M] (rev a1)

Installation:

Sudo apt-get install xbacklight-y

Command Introduction

Xbacklight-set 45 # xbacklight defines the brightness of the screen from 0 to 100. The brightness ranges from 0 to 100. The brightness ranges from 0 to, and the brightness ranges from to 45.
Xbacklight-dec 10 # decrease by 10 percentage points
Xbacklight-inc 10 # increase by 10 percentage points
Xbacklight # display the current screen brightness
Xbacklight-h # print help information

This is not easy enough, so I wrote a small script:

#! /Bin/bash
XBACKLIGHT_CFG = "$ {HOME}/. xbacklight. conf"
If [[$ #-eq 0]; then
Xbacklight-set $ (sed-n '1p' $ {XBACKLIGHT_CFG })
Else
Xbacklight $1 $2
Xbacklight >$ {XBACKLIGHT_CFG}
Fi

Save the above script as a text file. I named it xlight.

Then

Chmod a + x xlight
Sudo mv xlight/usr/bin

Next, we will set up a shortcut key to adjust the screen brightness: Turn On system settings-keyboard-Shortcut Key-custom shortcut (for example,), and set it to ctrl + alt + jk, which I like very much, to adjust the screen brightness.

Finally, we add xlight to auto start. We open dash and then search for START (ps: I often cannot enter Chinese Characters in dash and cannot search for English startup ...)

Ubuntu 14.04Download, install, configure related knowledge http://www.linuxidc.com/Linux/2014-04/100370.htm

Ubuntu 14.04: Http://www.linuxidc.com/Linux/2014-04/100352.htm

Ubuntu 14.04 text tutorial on hard drive installation in Windows 7Http://www.linuxidc.com/Linux/2014-04/100369.htm

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2014-09/106847.htm

Related Article

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.