VirtualKVM icon indicating copy to clipboard operation
VirtualKVM copied to clipboard

Temporarily disable sleep on client for clamshell mode

Open markturnip opened this issue 4 years ago • 3 comments

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 avatar Apr 15 '20 07:04 markturnip

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

markturnip avatar Apr 15 '20 07:04 markturnip

https://github.com/iccir/Fermata

markturnip avatar Apr 15 '20 07:04 markturnip

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);
}

markturnip avatar Apr 15 '20 08:04 markturnip