如何在 Linux 上更改显示器亮度?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6625836/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to change the Monitor brightness on Linux?
提问by Alexander Stolz
How do I programmatically change the monitor brightness on Linux?
如何在 Linux 上以编程方式更改显示器亮度?
I'm using SLES 11.
我正在使用 SLES 11。
回答by whoplisp
On my machine I run the following as root:
在我的机器上,我以 root 身份运行以下命令:
echo -n 10 > /sys/devices/virtual/backlight/acpi_video0/brightness
回答by rockerest
回答by christof
You can always use
您可以随时使用
xrandr --output LVDS1 --brightness 0.9
回答by foxhead128
You can try using xbacklight.
您可以尝试使用 xbacklight。
xbacklight -set 100
xbacklight -set 100
回答by chirag singh
edit /etc/default/grub file and add
编辑 /etc/default/grub 文件并添加
“pcie_aspm=force acpi_backlight=vendor” after
“pcie_aspm=force acpi_backlight=vendor”
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
GRUB_CMDLINE_LINUX_DEFAULT=”安静的飞溅”
after the changes whole line will look like this
更改后整行将如下所示
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash pcie_aspm=force acpi_backlight=vendor”
GRUB_CMDLINE_LINUX_DEFAULT=”安静飞溅 pcie_aspm=force acpi_backlight=vendor”
for complete detail visit the link.
有关完整的详细信息,请访问链接。
http://hackingzones.com/increasedecrease-brightness-in-linux-ubuntu-pear-os-backtrackkali/
http://hackingzones.com/increasedecrease-brightness-in-linux-ubuntu-pear-os-backtrackkali/
Chirag Singh
奇拉格·辛格
回答by artemis_clyde
For me it works perfectly with xbacklight
.
If you for example wish to set up a key binding, you can use
对我来说,它与xbacklight
. 例如,如果您希望设置键绑定,则可以使用
bindsym $SUPER+Shift+plus exec xbacklight -inc 10
bindsym $SUPER+Shift+minus exec xbacklight -dec 10
in your window managers config (I use i3) to regulate your screen's brightness level.
在您的窗口管理器配置中(我使用 i3)来调节屏幕的亮度级别。
I wouldn't recommend xrandr
for this since it doesn't stop at 100% brightness automatically.
我不建议xrandr
这样做,因为它不会自动停止在 100% 亮度。
回答by 13DaGGeR
If you have multipledisplays and php installed, put this in
如果您安装了多个显示器和 php,请将其放入
/usr/bin/brightness
/usr/bin/亮度
#!/usr/bin/php
<?
$br=(double)$argv[1];
if(!$br||$br>1) die("enter brightness lvl 0.1 - 1");
preg_match_all('!^(\S+)!m',`xrandr --current | grep ' connected'`,$m);
foreach($m[1] as $display){
echo `xrandr --output $display --brightness $br`."\n";
}
than call brightness .7
比打电话 brightness .7