This extends the 'Optical Output' setting to 'Off / Battery Only / Plugged only / Battery & Plugged' on platforms that support it: http://www.rockbox.org/bugs/task/4774
Useful eg. when (like me) you use the optical at home but don't want to waste battery juice on the go.
--gl
