Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable or disable KeepingYouAwake on specific (user defined) battery levels #24

Closed
timbru31 opened this issue May 23, 2015 · 9 comments
Closed

Comments

@timbru31
Copy link

Hi,

I've got a suggestion.
Maybe a feature can be added that disables KeepingYouAwake when e.g. the battery level is <10% and re-enables it on either AC connection or when the battery level is >10% again.

Cheers,
Tim

@derhuerst
Copy link

Maybe this is possible with Automator?

@KyleKing
Copy link

Good idea! However, there doesn't seem to be a nice way of integrating this functionality to the app (you would need to run a task ever ten-fifteen minutes to check the battery level). So building your own tool might be the easiest.

  • If you wanted to poll the battery percentage and build it your own way, try: pmset -g everything | grep Cycles. This guide walks you through it and I think this might be your best bet.
  • The easiest (i.e expensive) solution is the DssW Power Manager and this guide would guide you through the whole setup.
  • I looked into Battery-Time-Remaining (but it only creates a notification and doesn't seem to trigger a script) and Griffin proxi which doesn't run on my computer

Anyone else know of a better option? Is there a way to build an event listener that wouldn't rely on cron or launchd?

@newmarcel
Copy link
Owner

This might actually be possible with the IOPowerSources APIs… I'll look into it.

(Stack Overflow article for reference: http://stackoverflow.com/a/272774 )

@newmarcel
Copy link
Owner

You can now test this feature in the first beta for 1.4.0: https://github.com/newmarcel/KeepingYouAwake/releases/tag/1.4beta1

@timbru31
Copy link
Author

timbru31 commented Feb 6, 2016

This is great news! Going to test it 🚀

@timbru31
Copy link
Author

timbru31 commented Feb 7, 2016

The feature works great, I only have two things:

  • When KeepingYouAwake you is enabled currently and I adjust the slider it disabled KeepingYouAwake, even when the configured level is not reached
  • When the configured level is reached again, KeepingYouAwake could be auto-enabled again.

Thanks,
Tim

@alexandreleroux
Copy link
Contributor

Should this issue should be closed, now that it's part of release 1.4.0? Not sure if it has been implemented like @timbru31 suggested though.

@newmarcel
Copy link
Owner

I'll keep this issue open until I have implemented the mentioned feedback.

  1. To avoid some internal state handling I decided to deactivate the app when the checkbox or slider for this feature are modified. I'll try to come up with a cleaner solution.

  2. This is a tricky one (auto-enabling the app when you charge your Mac) and would require more internal state handling. I'll think about it, but it's likely at the moment, that I won't implement it.

@newmarcel
Copy link
Owner

Closed and moved to the Wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants