Skip to content

Conversation

@saltnpepper97
Copy link

@saltnpepper97 saltnpepper97 commented Dec 13, 2025

Implements custom org.quickshell.SessionLock DBus interface to expose session lock state, allowing external applications (idle managers, system monitors, etc.) to track when quickshell's lock screen is active without conflicting with screensaver inhibitors.

Changes

  • Added org.quickshell.SessionLock DBus adaptor in src/dbus/
  • Integrated DBus notifications into SessionLockManager
  • Emits LockedChanged and SecureChanged signals on lock/unlock
  • Provides GetLocked() and GetSecure() methods to query lock state
  • DBus adaptor is initialized immediately when SessionLockManager is created

Interface Details

  • Service: org.quickshell.SessionLock
  • Object Path: /org/quickshell/SessionLock
  • Methods:
    • GetLocked() - Returns true if locked
    • GetSecure() - Returns true if compositor confirmed lock
  • Signals:
    • LockedChanged(bool) - Emitted on lock state change
    • SecureChanged(bool) - Emitted when compositor confirms/releases lock

Rationale

Uses a custom interface instead of org.freedesktop.ScreenSaver to avoid conflicts with screensaver daemons, idle monitors, and compositors that need to own that interface for handling screensaver inhibit requests from applications like Firefox.

Testing

# Monitor lock state changes
dbus-monitor "interface='org.quickshell.SessionLock'"

# Query current state
qdbus org.quickshell.SessionLock /org/quickshell/SessionLock org.quickshell.SessionLock.GetLocked

@saltnpepper97 saltnpepper97 force-pushed the master branch 10 times, most recently from bc48777 to 7e60a4d Compare December 14, 2025 04:43
@saltnpepper97
Copy link
Author

Hello,

Sorry for the messy commits. This was my first time working with Qt, and it’s been a long time since I last touched C++. The linter and I spent some time fighting each other along the way.

Thanks for your patience!

@bbedward
Copy link
Contributor

I think that unconditionally registering the screensaver interface has a lot more considerations than just lock screen - because this would make it so nothing else could own the screensaver interface (like real screensaver apps, idle monitors, compositors)

  • niri at least does this, so it can respect screensaver inhibit (treated as an idle inhibit)
  • Inhibit is important for say, firefox calls inhibit on the screensaver interface when playing media (you'd usually want to create an idle inhibitor in that case to prevent locking/sleep)

If this is implemented in quickshell I think it'd make more sense as something that can be conditionally registered, since it wont work all the time anyway (like on niri)

Screensaver {
  onInhibited
  enabled
}

idk something like that, that's just my thoughts (not outfoxxed)

@saltnpepper97
Copy link
Author

I think that unconditionally registering the screensaver interface has a lot more considerations than just lock screen - because this would make it so nothing else could own the screensaver interface (like real screensaver apps, idle monitors, compositors)

* niri at least does this, so it can respect screensaver inhibit (treated as an idle inhibit)

* Inhibit is important for say, firefox calls inhibit on the screensaver interface when playing media (you'd usually want to create an idle inhibitor in that case to prevent locking/sleep)

If this is implemented in quickshell I think it'd make more sense as something that can be conditionally registered, since it wont work all the time anyway (like on niri)

Screensaver {
  onInhibited
  enabled
}

idk something like that, that's just my thoughts (not outfoxxed)

@bbedward Been hard at work. After further inspection you were correct, that was an oversight on my part so instead what I did was make a custom interface for quickshell

org.quickshell.SessionLock to bind to that instead so it shuld be free of other traffic as it's now custom :)

Just testing it at the moment. then linter fighting. Say any way to install tidyfox on arch linux without having to downloads the tar and unzip and just release and cp myself??? so that when testing my changes and fmt and such might be streamlined?

@saltnpepper97 saltnpepper97 changed the title feat: add DBus ScreenSaver interface for lock screen state tracking feat: add Custom DBus interface for Quickshell SessionLock Dec 16, 2025
@saltnpepper97
Copy link
Author

@bbedward DONE, now it's on a custom interface no need to worry about ScreenSaver :)

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 this pull request may close these issues.

2 participants