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

Provide a mechanism for binding actions on session lock/unlock events #7008

Open
roosemberth opened this issue May 16, 2022 · 2 comments
Open
Labels
enhancement New feature or incremental improvement

Comments

@roosemberth
Copy link
Contributor

Originally motivated by #7007

User automation can benefit from knowing whether a session is locked. For example, automation can stop a time-tracking software when the screen is locked and prompt the user whether they'd like to continue the tracker when the session is unlocked.

systemd-logind provides support for this, but it needs to be notified about this hint.

@kennylevinsen proposed a solution which could be reused by platforms not running (e)loggind:

If we need lock hooks, we should just have a form of event bind - one my event go as far as calling the command bindevent - so you can trigger something when lock/unlock happens.

The comment is a bit ambiguous, but the way I understand it is to have a new command bindevent (similar to bindsym or bindswitch), and users could run an arbitrary command (eg. dbus-send --system --dest=org.freedesktop.login1 /org/freedesktop/login1/session/self org.freedesktop.login1.Session.SetLockedHint boolean:false to address the original issue).

@roosemberth roosemberth added the enhancement New feature or incremental improvement label May 16, 2022
@Vladimir-csp
Copy link

either that or extend bindswitch to support other events:

  • session_lock:on|off|toggle
  • output:connected|disconnected|changed
  • docked:on|off|toggle
  • input:connected|disconnected|changed

@emersion
Copy link
Member

I'd prefer to expose new IPC events, instead of adding bindevent. As a matter of fact IPC events already exist for outputs and inputs.

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

No branches or pull requests

3 participants