调节屏幕亮度

最大的社区版本,Ubuntu的发源地
回复
jimxxx
帖子: 21
注册时间: 2008-11-04 22:11
送出感谢: 0
接收感谢: 1 次

调节屏幕亮度

#1

帖子 jimxxx » 2013-05-11 21:49

Debian7 下,笔记本上按Fn+《--- 调节亮度时,可以看到出现的图标亮度减少,可是实际不变。同样,在设置中调亮度也是一样。解决办法:
这种方法的基本使用条件是:intel 显卡对背光亮度起作用,在“/sys/class/backlight”下面有两个目录“acpi_video0”和“intel_backlight”,按亮度调节键时只对“acpi_video0”下面的“brightness”起作用,但真正对背光亮度起作用却是“intel_backlight”下面的“brightness”值

wrote a rules of "/etc/udev/rules.d/99-writeintelbacklight.rules" as below:

ACTION=="change", SUBSYSTEM=="backlight", RUN+="/usr/sbin/writeintelbacklight.sh"

A shell: "/usr/sbin/writeintelbacklight.sh"

#!/bin/bash

intelmaxbrightness=`cat /sys/class/backlight/intel_backlight/max_brightness`
acpimaxbrightness=`cat /sys/class/backlight/acpi_video0/max_brightness`
scale=`expr $intelmaxbrightness / $acpimaxbrightness`
acpibrightness=`cat /sys/class/backlight/acpi_video0/brightness`
newintelbrightness=`expr $acpibrightness \* $scale`
curintelbrightness=`cat /sys/class/backlight/intel_backlight/actual_brightness`
if [ "$newintelbrightness" -ne "$curintelbrightness" ]
then
echo $newintelbrightness > /sys/class/backlight/intel_backlight/brightness
fi
exit 0

Of course, you need do a "sudo chmod +x /usr/sbin/writeintelbacklight.sh"

反正我是通过这种方法解决了这个问题,特此分享
这些用户感谢了作者 jimxxx 于这个帖子:
blueyi (2014-04-14 21:56)
评价: 3.7%
头像
warmsun
帖子: 910
注册时间: 2010-09-23 11:49
送出感谢: 5 次
接收感谢: 6 次

Re: 调节屏幕亮度

#2

帖子 warmsun » 2013-05-12 13:36

虽然无此问题~还是感谢分享
我是小白我怕谁?
时隔多年,升级为大白,我是大白我怕谁?
ubuntu-->Debian-->Arch-->??
xdyplaystation
帖子: 1
注册时间: 2012-07-22 7:45
送出感谢: 0
接收感谢: 0

Re: 调节屏幕亮度

#3

帖子 xdyplaystation » 2013-11-01 15:18

jimxxx 写了:Debian7 下,笔记本上按Fn+《--- 调节亮度时,可以看到出现的图标亮度减少,可是实际不变。同样,在设置中调亮度也是一样。解决办法:
这种方法的基本使用条件是:intel 显卡对背光亮度起作用,在“/sys/class/backlight”下面有两个目录“acpi_video0”和“intel_backlight”,按亮度调节键时只对“acpi_video0”下面的“brightness”起作用,但真正对背光亮度起作用却是“intel_backlight”下面的“brightness”值

wrote a rules of "/etc/udev/rules.d/99-writeintelbacklight.rules" as below:

ACTION=="change", SUBSYSTEM=="backlight", RUN+="/usr/sbin/writeintelbacklight.sh"

A shell: "/usr/sbin/writeintelbacklight.sh"

#!/bin/bash

intelmaxbrightness=`cat /sys/class/backlight/intel_backlight/max_brightness`
acpimaxbrightness=`cat /sys/class/backlight/acpi_video0/max_brightness`
scale=`expr $intelmaxbrightness / $acpimaxbrightness`
acpibrightness=`cat /sys/class/backlight/acpi_video0/brightness`
newintelbrightness=`expr $acpibrightness \* $scale`
curintelbrightness=`cat /sys/class/backlight/intel_backlight/actual_brightness`
if [ "$newintelbrightness" -ne "$curintelbrightness" ]
then
echo $newintelbrightness > /sys/class/backlight/intel_backlight/brightness
fi
exit 0

Of course, you need do a "sudo chmod +x /usr/sbin/writeintelbacklight.sh"

反正我是通过这种方法解决了这个问题,特此分享



:em11 非常感谢楼主,解决了我的问题。唯一的差别是我的环境需要脚本中读 acpi_video1 这个, 这两天眼睛要被亮瞎了。 非常感谢!! :em11
napoleonlijun
帖子: 2
注册时间: 2013-01-02 1:18
系统: ubuntu12.10
送出感谢: 0
接收感谢: 0

Re: 调节屏幕亮度

#4

帖子 napoleonlijun » 2013-12-13 22:11

thank you me too but my file is video1
onlylove
论坛版主
帖子: 4437
注册时间: 2007-01-14 16:23
送出感谢: 0
接收感谢: 100 次

Re: 调节屏幕亮度

#5

帖子 onlylove » 2013-12-14 14:08

核心显卡?
#include <stdio.h>
void main()
{
double world;
unsigned letter;
short stay;
long memories;
printf("I miss you.\n");
}
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙
送出感谢: 4 次
接收感谢: 256 次

Re: 调节屏幕亮度

#6

帖子 eexpress » 2013-12-16 9:18

这只是hack下udev的设置错误。
● 鸣学
jzhur0726
帖子: 2
注册时间: 2013-05-11 13:41
系统: ubuntu-12-10
送出感谢: 0
接收感谢: 0

Re: 调节屏幕亮度

#7

帖子 jzhur0726 » 2013-12-22 3:32

jimxxx 写了:Debian7 下,笔记本上按Fn+《--- 调节亮度时,可以看到出现的图标亮度减少,可是实际不变。同样,在设置中调亮度也是一样。解决办法:
这种方法的基本使用条件是:intel 显卡对背光亮度起作用,在“/sys/class/backlight”下面有两个目录“acpi_video0”和“intel_backlight”,按亮度调节键时只对“acpi_video0”下面的“brightness”起作用,但真正对背光亮度起作用却是“intel_backlight”下面的“brightness”值

wrote a rules of "/etc/udev/rules.d/99-writeintelbacklight.rules" as below:

ACTION=="change", SUBSYSTEM=="backlight", RUN+="/usr/sbin/writeintelbacklight.sh"

A shell: "/usr/sbin/writeintelbacklight.sh"

#!/bin/bash

intelmaxbrightness=`cat /sys/class/backlight/intel_backlight/max_brightness`
acpimaxbrightness=`cat /sys/class/backlight/acpi_video0/max_brightness`
scale=`expr $intelmaxbrightness / $acpimaxbrightness`
acpibrightness=`cat /sys/class/backlight/acpi_video0/brightness`
newintelbrightness=`expr $acpibrightness \* $scale`
curintelbrightness=`cat /sys/class/backlight/intel_backlight/actual_brightness`
if [ "$newintelbrightness" -ne "$curintelbrightness" ]
then
echo $newintelbrightness > /sys/class/backlight/intel_backlight/brightness
fi
exit 0

Of course, you need do a "sudo chmod +x /usr/sbin/writeintelbacklight.sh"

反正我是通过这种方法解决了这个问题,特此分享
chmod: 无法访问"/usr/sbin/writeintelbacklight.sh": 没有那个文件或目录
陈小草
帖子: 102
注册时间: 2010-06-02 19:35
来自: blog.wencan.org
送出感谢: 0
接收感谢: 0

Re: 调节屏幕亮度

#8

帖子 陈小草 » 2014-01-05 10:47

多此一举

gnome3有个扩展可以调节亮度
支持开机自动恢复关机时的亮度
b l o g
blueyi
帖子: 28
注册时间: 2010-01-17 3:27
送出感谢: 1 次
接收感谢: 0

Re: 调节屏幕亮度

#9

帖子 blueyi » 2014-04-13 23:02

很久没回帖了,今天特别登录上回复一次,这个问题让我花了好多个夜晚未搞定,非常感谢,想知道原文在哪,为何我google如此多的帖子未找到这个,谢谢
blueyi
帖子: 28
注册时间: 2010-01-17 3:27
送出感谢: 1 次
接收感谢: 0

Re: 调节屏幕亮度

#10

帖子 blueyi » 2014-04-14 22:06

另外一个问题想楼主是如何解决的,就是这样调整亮度之后,重启机器亮度就又变成最大了。突然想起来很多年前,大学时使用ubuntu8.04,一安装完系统就什么都看不见了,明显能感觉到机子已经启动了,难道是由于屏幕亮度自动变成最低导致什么也看不见了吗。还好,现在是最亮的,请问楼主是否可以保存亮度呢,谢谢
回复

回到 “Debian发行版”