11

I do not want my laptop to change brightness when my laptop power is plugged in or unplugged. I set my brightness based on how bright my surroundings are. If I am in a dark room, I set my brightness very low and when I plug my laptop in the brightness gets set to maximum which feels like sticking my eyes in boiling lava.

In System SettingsBrightness and Lock the Dim screen to save power checkbox is unchecked.

My laptop is an HP Mini 110

In case it is an acpi issue I have put my acpi-support file here
[link removed because it expired]

Thomas Ward
  • 80,112
DavidW
  • 310

7 Answers7

5

I tested a solution that works fine for me. One solution is to add a script file in /etc/pm/power.d/

Just creates a file

sudo vi /etc/pm/power.d/run_after_pwrmanagmt.sh

Then writes this code into this file :

case "${1}" in
    true) #battery_mode
        xinput set-int-prop 12 277 8 2 3 0 0 1 3 2
        echo 4000 > /sys/class/backlight/intel_backlight/brightness
;;
    false) #ac_mode
        xinput set-int-prop 12 277 8 2 3 0 0 1 3 2
        echo 4000 > /sys/class/backlight/intel_backlight/brightness
esac

Now, you need to give execution rights to this file by typing

sudo chmod +x /etc/pm/power.d/run_after_pwrmanagmt.sh

Now it should work fine, just test to plug/unplug your computer. Note that you can do similar things after a suspend (/etc/pm/sleep.d/run_after_sleep.sh), that's how I found out this solution... You will find information on the web...

Note that xinput is just a command for my trackpad to set the middle button working... You should skip the two lines xinput if not needed (or adapt ). For the value 4000, it may be diffrent for each screen, you should first see what is your max value with the command cat /sys/class/backlight/intel_backlight/max_brightness

Hope this helps, and that the moderator will not delete this post since this is an answer and not a question. Thanks

Zachu
  • 3
1

Using the dconf editor (https://pkgs.org/download/dconf-editor), navigate to the following directory:

org/gnome/shell/extensions/dim-on-battery

And set the key legacy-mode to On. Now, your PC will memorize your last settings when using the bright control. If you don't want them to change when plugging in/out the AC supply, just set them to the same value.

1

This worked for my Acer Nitro 5. I edited the grub file which is at /etc/default/grub by adding acpi_backlight=vendor to the end of GRUB_CMDLINE_LINUX_DEFAULT="quiet splash", so the result looks like this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"

Then I ran update-grub command in the terminal and restarted the machine.

This basically allows loading the vendor drivers before the Linux drivers.

Hasan Aga
  • 325
1

The only option that worked for me was to do this:

me=`whoami`
max=`cat /sys/class/backlight/radeon_bl0/max_brightness`
sudo chown ${me}:${me} /sys/class/backlight/radeon_bl0/brightness
sudo chmod o+x /sys/class/backlight/radeon_bl0/brightness
echo ${max} > /sys/class/backlight/radeon_bl0/brightness
sudo chmod 444 /sys/class/backlight/radeon_bl0/brightness
sudo chown root:root /sys/class/backlight/radeon_bl0/brightness
exit

I know it's not the prettiest, but it works. I just put this into a script and if my brightness ever dims on me, I just run it and it instantly changes it back for me.

anonymous2
  • 4,325
0

Just ran into the same problem on my Dell Vostro.

It turned out that Ubuntu just saves brightness level set by fn+brightness keys on my laptop. But it saves different levels for different states: plugged and unplugged. So, I just had to set up my brightness level twice, once on battery, and once plugged in :)

I know it's super easy, but I still had to search a bit before I came up to this. Maybe it will help someone else.

Zanna
  • 72,471
Stan
  • 1
0

For me (with Lenovo X61s) the unwanted display dimming when unplugging from line power was apparently not related to power management software or similar, but rather due to a BIOS setting for screen brightness in Config-Display. Via that BIOS setting it was possible to avoid the dimming.

-1

Under "brightness and lock" in the system settings, remove the checkbox from "Dim screen to save power".

This will keep your screen at the same brightness all the time, instead of dimming it when running on battery power and making it brighter when it's on mains power.

You should still be able to adjust the screen brightness manually as you desire in order to save power or when you need more light.

If your "brightness and lock" settings do not have this option, then you have a different issue, so let us know.

thomasrutter
  • 37,874