-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Prevent machines from sleeping #58
Comments
Does teleport keep a persistent connection to the machine? I looked at this a bit today (while building #65) and it didn't seem like there was a persistent control channel that could be used to send wakeup events. If not then maybe something like the below would work? [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(screensDidWake:) name:NSWorkspaceScreensDidWakeNotification object:nil];
- (void)screensDidWake:(NSNotification*)notification
{
NSLog(@"waking screens");
NSArray *hosts = [[TPHostsManager defaultManager] hostsWithState:TPHostOnlineState];
for (TPRemoteHost *host in hosts) {
BOOL isLocalHost = [host isEqual:[TPLocalHost localHost]];
if (!isLocalHost) {
//init a connection and send an event that triggers wakeUpScreen on the target machine
}
}
} This would only wake all the screens at the same time though, so you'd also want something on a timer to keep sending those wakeup events to the clients every [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(screensDidSleep:) name:NSWorkspaceScreensDidSleepNotification object:nil];
- (void)screensDidSleep:(NSNotification*)notification
{
NSLog(@"sleeping screens");
// disable the wake loop and then send sleep commands to every client
} A - (void)sleepScreen {
io_registry_entry_t entry = IORegistryEntryFromPath(kIOMasterPortDefault,
"IOService:/IOResources/IODisplayWrangler");
if (entry != MACH_PORT_NULL) {
IORegistryEntrySetCFProperty(entry, CFSTR("IORequestIdle"), kCFBooleanTrue);
IOObjectRelease(entry);
}
} |
Some of this issue was addressed in #66, but I think there's still more to do before we call this resolved. |
From #66
I don't think we should require the user to set specific sleep settings in preferences because it's possible that the machine is portable and it's not always paired. In my case, I control a MacBook Air when I'm at my desk, but that machine also goes with me when I travel. I don't want to change the way I have it configured but I do want it to stay awake when it's being controlled with Teleport. As of |
Interesting -- on my setup I don't need to mouseover to keep the screen from locking. If you're on Big Sur 11.1 it would seem there are differences in behavior here that bear closer investigation... |
I'm using Catalina on the controlling machine and Big Sur on the controlled machine. |
Feature request
A detailed description of the proposed feature
It would be helpful if the Teleport could keep my machines awake. When my server connects to a client and controls it remotely, it's not uncommon for the server to sleep the display. Likewise when I'm using the server it's common for the client to sleep the display.
The motivation for the feature
When Teleport is active, I want all of my connected machines to stay awake if I am active on any of the connected machines. Alternatively, the ability to wake a machine when the mouse would move to it would also be good but might be harder to implement.
How the feature would be relevant to at least 90% of Teleport users
Anyone who uses one computer for a prolonged period of time will have this issue.
What alternatives to the feature have been considered
Use an external application like Amphetamine to keep the machines from sleeping. This works, but it keeps the machines awake indefinitely and it would be more convenient if they went to sleep on a normal schedule when not in use.
The text was updated successfully, but these errors were encountered: