This simple tutorial is going to show how to set two different screen brightness levels for AC adapter or on battery.
So Ubuntu 18.04 (or Ubuntu 19.10) laptop with the default Gnome 3 desktop will automatically dim screen when the charger is unplugged.
1.) Open Ubuntu Software, search for and install ‘dim on battery power’ (without quote).
2.) Then launch the extension settings either in Ubuntu Software or via Gnome Tweaks > Extensions (install Gnome Tweaks via Ubuntu Software).
When it opens, change the values of screen brightness on battery or AC power.
That’s it. Enjoy!