on_ac_power && echo yes The real thing would be, however, to start indexing on plug-in, and pause it with plug-out (battery). I don't know if beagle supports pausing, but on laptops this is generally a good idea, so how about filing a feature request.