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

[Feature Request] Check for screen lock #11

Closed
bkbilly opened this issue May 3, 2022 · 2 comments
Closed

[Feature Request] Check for screen lock #11

bkbilly opened this issue May 3, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@bkbilly
Copy link
Owner

bkbilly commented May 3, 2022

Used for triggering lights when the PC locks/unlocks.

@bkbilly bkbilly added the enhancement New feature or request label May 3, 2022
@bkbilly
Copy link
Owner Author

bkbilly commented May 4, 2022

I can't seem to find a way to find if the screen is locked

@bkbilly bkbilly closed this as completed May 4, 2022
@Dinth
Copy link

Dinth commented Oct 27, 2022

I dont think that there is a simple & universal way to check that regardless of the desktop environment running on a computer, but it should be possible to check that for the main environments out there.
The simplest way of doing that would be to check if screensaver process is running (for example for KDE this will be kscreenlocker)
or you could use dbus:

$ qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.GetActive
$ qdbus org.kde.screensaver /ScreenSaver org.freedesktop.ScreenSaver.GetActive
$ qdbus org.gnome.ScreenSaver /ScreenSaver org.gnome.ScreenSaver.GetActive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants