integralpro / nosleep

The MacOS X kernel extension, preventing sleep when you close the lid.
GNU General Public License v2.0
874 stars 45 forks source link

Toggling state #10

Closed achampion closed 5 years ago

achampion commented 9 years ago

Left clicking used to toggle the state for the particular power source (AC, Battery). Now left clicking just brings up the same context menu as right clicking. Enable No Sleep in the context menu sets the state for all power sources, to have separate settings for AC and Battery now requires going into preferences.

jpage4500 commented 9 years ago

I actually just checked-in a change to do this on a fork - link below. It just toggles the state on/off when left-clicking (menu still opens on right-click).

https://github.com/jpage4500/nosleep/commit/86e3c1aff000cdf3b4a7d37a6cdc43bff17fad42

I did notice the individual AC and battery preferences - though I'm not sure they work as I'd expect them too.. when I uncheck battery the overall state gets turned OFF. But, I can see users wanting to prevent sleep on AC power only - in case they accidentally forget to turn OFF when on battery.

However, I don't understand the situation where a user would only want this active on battery and not AC..

Anyway, my thought is to keep the battery preference (checked by default) but not to change it when toggling the overall state. Does that make sense?

I should note I'm doing these changes on my fork.. I can ask the author if any of this is worth sending a pull request for so it can be part of the official version too.