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

Added functionality to activate keeping the mac awake when connected to AC power #187

Closed
wants to merge 1 commit into from

Conversation

sturza
Copy link

@sturza sturza commented Apr 26, 2022

I am happy to get other ideas on how to detect power source changes.
In any case, it implements #104

- (void)checkPowerSource
{
CFTypeRef powerSourceInfo = IOPSCopyPowerSourcesInfo();
CFArrayRef powerSources = IOPSCopyPowerSourcesList(powerSourceInfo);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation-wise this is certainly possible to solve it like that.

I would prefer to not add IOPowerSources code directly here in KYAAppController. This would probably be a better fit for KYABatteryMonitor. There is some pre-existing IOPowerSources code already, that could be extended, e.g. by adding concrete notifications for this connect/disconnect scenario.

@newmarcel
Copy link
Owner

Closed because of inactivity. Please open it again if development resumes, thanks.

@newmarcel newmarcel closed this Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants