修改ubuntu开机亮度

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

ubuntu 开机屏幕亮度调整
每次ubuntu系统启动后屏幕都可以当灯泡了!无论关机前怎样设置屏幕亮度,再开机屏幕都变成最亮,一直最亮的话既费电又对显示屏不好,但是每次启动后都要手动改,实在太麻烦了,网上搜索关键字 “ubuntu 开机 亮度”出来的结果通常都是让你修改:
“ /etc/laptop-mode/laptop-mode.conf”和“/etc/default/acpi-support”
这两个文件,但我修改后毫无用处,开机后屏幕依旧亮的刺眼,最后终于在一个博客上找到方法,测试可用。

(E文…… 百度渣翻译)
此方法适用于ubuntu11.10,11.04用户直接看文章最后
将下面这段代码保存为.py文件,找个地方保存好,例如我将此段代码保存在
/home/xxx/screenlight/low.py
代码中:<iface.SetPercentage(0)>的参数可以修改,数值范围0-100,可自行决定。

***************************************************************
import dbus
bus = dbus.SessionBus()
proxy = bus.get_object('org.gnome.SettingsDaemon','/org/gnome/SettingsDaemon/Power')
iface=dbus.Interface(proxy,dbus_interface='org.gnome.SettingsDaemon.Power.Screen')
iface.SetPercentage(0)
***************************************************************
将此文件权限修改为可执行,然后在“启动应用程序”将此文件设置为自启动(名称随便填,命令填python /你的文件路径/low.py, 快捷键的命令前也需要加python ),这样每次开机后都会自动将屏幕设置为你设置的亮度了。

也可以多复制几份这样的文件将亮度调成不同的等级,然后关联快捷键,这样就可以快速在低亮度和高亮度之间切换了。

Ps:如果想让此文件可以双击运行,可以在代码的第一行插入“#!/usr/bin/python”,加这条命令的话“启动应用程序”和“快捷键”的命令可以不加”python”
英文原文:
When ever I restart (or logout and login) my laptop the LCD display brightness is set to the maximum value. Even if I set the brightness
settings in the power to the value I need, they won’t be in effect when I restart the machine.
To solve this problem I wrote the following python script. First you need to add it to the startup applications list. The command to be given in the startup applications is “python
/<path>/<to>/<script>/setBrightness.py”.
By default, the script will set the brightness to the minimum value. But if you want to change this, you can do that by editing the value 0 of the “value” variable to any value between 0 to 100.
Download::
/attachments/category/40/setBrightness.py
PS:
It seems that D-bus interfaces have been changed recently (From Gnome 3 on wards). So if you use Ubuntu 11.10 or any other gnome 3 compatible OS, please use the following script.
/attachments/article/65/setBrightness.py
All of the above code can now be conveniently accessed from Git-hub via https:///ishanthilina/setBrightness. There are branches for every version of the script.。

相关文档
最新文档