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

[macOS] Set state to AFK when screen is locked or computer is asleep #66

Open
amsam0 opened this issue Jan 26, 2024 · 1 comment · May be fixed by #69
Open

[macOS] Set state to AFK when screen is locked or computer is asleep #66

amsam0 opened this issue Jan 26, 2024 · 1 comment · May be fixed by #69

Comments

@amsam0
Copy link

amsam0 commented Jan 26, 2024

I suggest that whenever loginwindow is the current window on macOS, the state be changed to AFK. loginwindow is what is shown when the computer is locked, which means the user is away from their computer. This can be observed with aw-watcher-window.

@amsam0
Copy link
Author

amsam0 commented Jan 28, 2024

A better way to do this would be to check the CGSSessionScreenIsLocked key of the session info dictionary. See this StackOverflow answer for more info: https://stackoverflow.com/a/11511419

There is also a pure bash answer, if the Quartz library is not available (it wasn't when I tried): https://stackoverflow.com/a/66723000

This solution can also be easily packaged into a ~10 line C program, let me know if that would be useful.

@amsam0 amsam0 changed the title [macOS] The state should be changed to AFK when loginwindow is the current window [macOS] Set state to AFK when screen is locked or computer is asleep Jan 28, 2024
@amsam0 amsam0 linked a pull request Oct 25, 2024 that will close this issue
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 a pull request may close this issue.

1 participant