Posted on 12-21-2017 10:39 AM
Has anyone created a rule based on a portable computer being plugged in or using battery. I'm trying to see if I could restrict software from running only if the device is on battery power.
I'd be interested in stopping students from playing games while in school since their device is on battery but once they are home and plugged in it would allow the game to be played. It might solve a couple things, one of them conserving battery life.
Thanks,
Rich
Posted on 12-22-2017 03:57 AM
The terminal command
pmset -g ac
Will tell you whether a charger is attached or not.
If one is attached, you will get details of the charger
Wattage = 60W Revision = 0x0000 AdapterID = 256 Family Code = 0x00ba Serial Number = <redacted>
If it's not, it will return
No adapter attached.
You should be able to cook up a script and rule to run the check with that information
Posted on 12-26-2017 08:57 PM
I also have the same question, waiting for suggestions