7

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
http://paste.ubuntu.com/1008244/

  • Are you still using ACPI events? – pschmidt May 16 '12 at 22:31
  • How can I check? – DavidW May 26 '12 at 15:18
  • I have Dell v131 laptop. This issue finally disappeared after upgrade to ubuntu 16.10. – azurkin Oct 16 '16 at 15:33
4

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

  • This is a super-complicated answer for such a simple question! Try looking at the other answers for a something simpler. – intrepidis Jun 8 '14 at 20:12
  • What if there is no directory power.d? – Pithikos Jan 11 '15 at 20:16
  • @Albin For me, the script couldn't be run but manually (yes, I marked it as executable). – LogicStuff Jul 19 '16 at 12:31
  • You should consider editing out the xinput thing. I see people everywhere copy-pasting your solution with the xinput command that they do not need at all. – Andrea Lazzarotto Sep 1 '16 at 20:18
0

Just ran into the same problem on my Dell Vostro. Here's the solution that worked for me:

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

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

  • What are you saying? Does it even makes sense? even to you?? – Kishan Mar 4 '18 at 5:05
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.

0

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.

-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.

  • The checkbox "Dim screen to save power" is not checked. – DavidW May 24 '12 at 14:24
  • In that case you may want to add this information to your question, as well as information about which laptop you have. – thomasrutter May 24 '12 at 23:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.