Skip to content

Add login session tracking#84

Merged
Aetf merged 5 commits intoAetf:developfrom
michael-oberpriller:Login-Session-Tracking
Feb 12, 2025
Merged

Add login session tracking#84
Aetf merged 5 commits intoAetf:developfrom
michael-oberpriller:Login-Session-Tracking

Conversation

@michael-oberpriller
Copy link

This adds support for tracking systemd's session events in addition to the already supported seat events. This is done by adding a new systemd monitor to the event loop. The only functionality added so far is to check for updates on a session's type. On any session event, each seat will receive a UTERM_MONITOR_UPDATE_SESSIONS event. Each seat then checks the type of all of its sessions and checks whether it has been changed. If it has changed, the awake status of the session's terminal is updated appropriately.
When a graphical session is launched from a kmscon terminal, it will update the session type from "tty" to "wayland"/"x11". This property was used to update a terminal's awake status to false when a graphical session is launched within it. This prevents the terminal from reading keyboard events, thus fixing kmscon#144. It also prevents other unnecessary background updates. When a graphical session is exited, the session's type is reverted to "tty", thus the terminal can then be updated to awake again.

@m-bdf
Copy link

m-bdf commented Aug 6, 2024

Can confirm it works on NixOS with uwsm and river (Wayland).

@michael-oberpriller michael-oberpriller marked this pull request as draft September 14, 2024 15:57
@michael-oberpriller michael-oberpriller marked this pull request as ready for review February 12, 2025 03:01
@michael-oberpriller
Copy link
Author

I cleaned up some of the monitor code and now I believe this is ready to be merged.

Copy link
Owner

@Aetf Aetf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Aetf Aetf merged commit fbb4d02 into Aetf:develop Feb 12, 2025
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.

3 participants