Skip to content

Detect that screen is locked #422

Description

@cunlem

I want to use short timeout with swayidle to power off screen when it's locked. The hard part is detecting that screen lock is active. Currently the only way is grepping process table:

pgrep -x -u "$USER" swaylock

Or a bit "better" but even more verbose by taking session into account:

pgrep -x --cgroup "/user.slice/user-$(id -u).slice/session-$XDG_SESSION_ID.scope" swaylock

Obviously there must be a better way that queries Wayland server directly? Could additional mode of operation be added to swaylock that does exactly that?

This is somewhat related to swaywm/swayidle#2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions