How to change the Monitor brightness on Linux?

前端 未结 9 512
离开以前
离开以前 2020-12-24 07:38

How do I programmatically change the monitor brightness on Linux?

I\'m using SLES 11.

相关标签:
9条回答
  • 2020-12-24 08:12

    edit /etc/default/grub file and add

    “pcie_aspm=force acpi_backlight=vendor” after

    GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
    

    after the changes, the whole line will look like this

    GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash pcie_aspm=force acpi_backlight=vendor”
    

    Chirag Singh

    0 讨论(0)
  • 2020-12-24 08:13

    If you have multiple displays and php installed, put this in

    /usr/bin/brightness

    #!/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

    0 讨论(0)
  • 2020-12-24 08:19

    You can try using xbacklight.

    xbacklight -set 100

    0 讨论(0)
  • 2020-12-24 08:21

    command for this:

    xgamma -gamma 0.7

    0 讨论(0)
  • 2020-12-24 08:28

    For me it works perfectly with xbacklight. If you for example wish to set up a key binding, you can use

    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.

    I wouldn't recommend xrandr for this since it doesn't stop at 100% brightness automatically.

    0 讨论(0)
  • 2020-12-24 08:28

    On my machine I run the following as root:

    echo -n 10 > /sys/devices/virtual/backlight/acpi_video0/brightness
    
    0 讨论(0)
提交回复
热议问题