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

Add login session tracking #84

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

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 dvdhrm#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
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