如何在 Linux 上更改显示器亮度?
如何在 Linux 上以编程方式更改显示器亮度?
我正在使用 SLES 11。
How do I programmatically change the monitor brightness on Linux?
I'm using SLES 11.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
仅适用于英特尔,但您可以使用
xbacklight
。创建/etc/X11/xorg.conf.d/20-intel.conf
然后添加Reboot,然后就可以使用
xbacklight -set somevalue
Works only for intel, but you can use
xbacklight
. Create a/etc/X11/xorg.conf.d/20-intel.conf
and then addReboot, and then you can use
xbacklight -set somevalue
编辑
/etc/default/grub
文件并在更改后添加
“pcie_aspm=force acpi_backlight=vendor”
,整行将如下
Chirag Singh
edit
/etc/default/grub
file and add“pcie_aspm=force acpi_backlight=vendor”
afterafter the changes, the whole line will look like this
Chirag Singh
命令:
xgamma -gamma 0.7
command for this:
xgamma -gamma 0.7
如果您有多个显示器并安装了 php,请将其放入
/usr/bin/brightness
中,而不是调用
brightness .7
If you have multiple displays and php installed, put this in
/usr/bin/brightness
than call
brightness .7
这是在基于Linux的系统中控制亮度的简单步骤
首先,您必须知道您连接的监控屏幕。
要了解这一点,请运行此命令
它将提供有关屏幕的有用信息
(这里我的屏幕连接到了 eDP,对于您的系统可能会有所不同)
知道后运行以下命令
xrandr --output eDP --brightness
[0-10]将上面输出中的 eDP 替换为您连接的屏幕。
您可以选择 0.1 到 1.0 之间的正常亮度值
Here is the simple step to control brightness in Linux based system
First, you have to know the monitoring screen connected you.
To know this run this command
It will give useful information about the screen
( Here my screen connected to eDP, It might be different for your system )
After knowing that run the below command
xrandr --output eDP --brightness
[0-10]Replace eDP by your connected screen from the above output.
you can choose normal brightness values from 0.1 to 1.0
ddcutil 应用程序可以通过 VESA DDC/MCCS 标准更改外部显示器的实际背光亮度(xrandr 只能在显示器当前设置的限制内移动 X11 输出,它不能改变实际的背光亮度)。这应该适用于通过显示数据通道支持该功能的任何显示器(DDC 已经存在一段时间了,它得到了广泛的支持,但仅适用于外部显示器)。我使用 ddcutil 根据从网络摄像头采样的环境光级别自动调整显示器。 Ddcutil 使用 i2c-dev 内核模块(modprobe i2c-dev 或将其设置为在启动时加载)。
The ddcutil application can change an external monitor's actual backlight brightness via the VESA DDC/MCCS standard (xrandr can only move the X11 output within a monitor's currently set limits, it can't change the actual backlight brightness). This should work for any monitors that support that capability via Display Data Channel (DDC has been around for some time, it is be widely supported, but for external monitors only). I use ddcutil to automatically adjust my monitor based on the ambient light level sampled from a webcam. Ddcutil uses the i2c-dev kernel module (modprobe i2c-dev or set it to load at boot).
您可能会考虑使用xgamma。虽然它不是纯代码,但至少它只是一个命令行实用程序。
You might look into using xgamma. Although it's not pure code, at least it's just a command line utility.
在我的机器上,我以 root 身份运行以下命令:
On my machine I run the following as root:
对我来说,它与 xbacklight 完美配合。
例如,如果您希望设置键绑定,您可以
在窗口管理器配置中使用(我使用 i3)来调节屏幕的亮度级别。
我不会为此推荐
xrandr
因为它不会自动停止在 100% 亮度。For me it works perfectly with
xbacklight
.If you for example wish to set up a key binding, you can use
in your window managers config (I use i3) to regulate your screen's brightness level.
I wouldn't recommend
xrandr
for this since it doesn't stop at 100% brightness automatically.您可以随时使用
You can always use
您可以尝试使用xbacklight。
xbacklight-设置 100
You can try using xbacklight.
xbacklight -set 100