As you may know, screen brightness drains battery, that's why it is considered a big problem for laptops (at least for me).
I can change the screen brightness but every time ubuntu boots up I will have to change it again.
Luckily, you can write a script that does that for you. However, when the laptop is plugged in I do want the maximum brightness; which means I will have to do that by myself every time I plug in the laptop.
Is there a script that detect if the laptop is charging or not and sets the brightness level accordingly?