Ubuntu 14.04笔记本开机屏幕亮度调节

简介:

1.问题引出:笔记本安装Ubuntu 14.04的屏幕亮度问题

    

    安装完Ubuntu 14.04,每次开机后,系统都把屏幕的亮度调节为最高,亮得不行,虽然说是可以使用Fn键进行屏幕亮度的调节,但是每次开机后都要这么做,这显然是低效率的,因此有没有一种办法可以设置系统在开机的时候就进行屏幕亮度的调节呢?




2.问题解决:屏幕亮度调节的配置文件+开机设置自动调节屏幕亮度


「屏幕亮度调节的配置文件」

(1)进入配置文件所在文件夹

1
xpleaf@leaf:~$ cd /sys/ class /backlight/intel_backlight/

至于是不是在intel_backlight目录则要看笔记本具体的型号,因为不同的笔记本,该目录的名称是不一样的,但是有一点是确定的,那就是一定会是在/sys/class/backlight/这个目录中。

(2)查看亮度调节的配置文件 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
xpleaf@leaf:~$ cd /sys/ class /backlight/intel_backlight/
xpleaf@leaf:/sys/ class /backlight/intel_backlight$ ll
总用量  0
drwxr-xr-x  3  root root     0   8 月  25  14 : 22  ./
drwxr-xr-x  4  root root     0   8 月  25  14 : 22  ../
-r--r--r--  1  root root  4096   8 月  25  14 : 22  actual_brightness
-rw-r--r--  1  root root  4096   8 月  25  14 : 22  bl_power
-rw-r--r--  1  root root  4096   8 月  25  14 : 20  brightness
lrwxrwxrwx  1  root root     0   8 月  25  14 : 22  device -> ../../card0-eDP- 1 /
-r--r--r--  1  root root  4096   8 月  25  14 : 22  max_brightness
drwxr-xr-x  2  root root     0   8 月  25  14 : 22  power/
lrwxrwxrwx  1  root root     0   8 月  25  14 : 22  subsystem -> ../../../../../../../ class /backlight/
-r--r--r--  1  root root  4096   8 月  25  14 : 22  type
-rw-r--r--  1  root root  4096   8 月  25  14 : 22  uevent

brightness与max_brightness就是与亮度调节相关的配置文件了,但是这里我们需要更改的是brightness文件,先看一看该文件的内容:

1
2
xpleaf@leaf:/sys/ class /backlight/intel_backlight$ cat brightness 
478

其实就是一个数字,我们直接配置该文件,是不会马上生效的,并且下一次系统重启时,还是会恢复原来的值,至于是不是真的如此,自己可以做测试。因此,我们就需要在系统开机的时候就来设置该文件的值。




「开机设置自动调节屏幕亮度」

我们只要把下面的内容添加到/etc/rc.local中即可:

1
echo  250  > /sys/ class /backlight/intel_backlight/brightness

250只是我想要的亮度而已,根据实际情况自己设置吧。


配置/etc/rc.local文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
xpleaf@leaf:~$ sudo vim /etc/rc.local
[sudo] password  for  xpleaf: 
#!/bin/sh -e
#
# rc.local
#
# This script  is  executed at the end of  each  multiuser runlevel.
# Make sure that the script will  "exit 0"  on success or any other
# value on error.
#
# In order to enable or disable  this  script just change the execution
# bits.
#
# By  default  this  script does nothing.
echo  250  > /sys/ class /backlight/intel_backlight/brightness
exit  0

再重新启动系统,发现亮度已经被调节成我们想要的值了。

相关文章
|
27天前
|
Ubuntu NoSQL 关系型数据库
Ubuntu系统下安装常用软件
Ubuntu系统下安装常用软件
58 0
Ubuntu系统下安装常用软件
|
1月前
|
Ubuntu Linux C语言
Ubuntu下安装vscode,并解决终端打不开vscode的问题
Ubuntu下安装vscode,并解决终端打不开vscode的问题
148 0
|
2月前
|
存储 Ubuntu 网络协议
|
1月前
|
Ubuntu Docker 容器
如何在Ubuntu上安装Docker?
【2月更文挑战第10天】
257 0
|
2月前
|
负载均衡 Ubuntu 应用服务中间件
|
29天前
|
Ubuntu 关系型数据库 MySQL
Ubuntu 中apt 安装MySQL数据库
Ubuntu 中apt 安装MySQL数据库
69 0
|
2天前
|
Ubuntu Linux Python
Linux(15)Ubuntu安装ninja构建工具
Linux(15)Ubuntu安装ninja构建工具
10 0
|
2天前
|
Ubuntu Linux 数据安全/隐私保护
Linux(7)Ubuntu20.04 arm64安装Docker
Linux(7)Ubuntu20.04 arm64安装Docker
12 0
|
2天前
|
存储 Ubuntu Docker
如何在 Ubuntu 上安装 Docker?
【4月更文挑战第17天】
33 8
如何在 Ubuntu 上安装 Docker?