VirtualKVM
VirtualKVM copied to clipboard
Temporarily disable sleep on client for clamshell mode
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
But maybe I could create a PR to allow auto disabling sleep mode when the host is connected?
https://github.com/iccir/Fermata
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);
}