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

Temporarily disable sleep on client for clamshell mode #67

Open
markturnip opened this issue Apr 15, 2020 · 3 comments
Open

Temporarily disable sleep on client for clamshell mode #67

markturnip opened this issue Apr 15, 2020 · 3 comments

Comments

@markturnip
Copy link

This works great! Thanks heaps.

Only drama is when putting my laptop into clamshell mode, VirtualKVM will auto switch displays and enable bluetooth; which results in not being able to wake laptop up from clamshell mode.

For now I've disabled sleep mode:
sudo pmset disablesleep 1

@markturnip
Copy link
Author

But maybe I could create a PR to allow auto disabling sleep mode when the host is connected?

@markturnip
Copy link
Author

@markturnip
Copy link
Author

Does mean including private headers

- (void)preventSleepWithReply:(void (^)(NSInteger error))reply {
    NSInteger status = IOPMSetSystemPowerSetting(kIOPMSleepDisabledKey, kCFBooleanTrue);
    if (reply) reply(status);
}


- (void)allowSleepWithReply:(void (^)(NSInteger error))reply {
    NSInteger status = IOPMSetSystemPowerSetting(kIOPMSleepDisabledKey, kCFBooleanFalse);
    if (reply) reply(status);
}

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

No branches or pull requests

1 participant