According to this answer in How to stop automatic brightness change while on battery?, there are two settings available through dconf-editor
(accessible by installing dconf-tools
):
- idle-dim-ac
- idle-dim-battery
Separately setting these values should allow the idle to only occur when on battery, rather than on AC.
Note: From comments on the answer, these options were not available in 14.04 at the time, but this may have been fixed.
Alternatively (from Terminal command for checking/unchecking “Dim screen to save power”?), you could write a script to enable/disable the option automatically if your computer changes from battery to AC or vice-versa (script copied ad verbatim from original answer):
#!/bin/bash
while true
do
if on_ac_power; then
gsettings set org.gnome.settings-daemon.plugins.power idle-dim true
else
gsettings set org.gnome.settings-daemon.plugins.power idle-dim false
fi
sleep 60 # check the state in each 60 seconds
done
Save the script.ex: dimscreen.sh
and run it by typing sh /path/to/dimscreen.sh
in Terminal.