shell icon indicating copy to clipboard operation
shell copied to clipboard

[FEATURE] Check if lockscreen is active

Open shadowburst opened this issue 1 year ago • 6 comments

Is your feature request related to a problem? Please describe. I like my screen to turn off sooner than usual when the screen is locked. Unless I'm mistaken, I can't currently find out whether it is or not via the quickshell IPC.

Describe the solution you'd like Add a function (like isActive or isLocked) to the lock module IPC handler.

Additional context I don't mind adding this myself, but I wanted to create an issue first, just in case there's already a way to do this that I'm not aware of.

shadowburst avatar Jun 25 '25 19:06 shadowburst

check /.config/hypr/hypridle.conf

dalpax avatar Jun 26 '25 05:06 dalpax

Oh I already am for detecting whether I'm idle or not. I currently have it so that the screen turns off after 5 minutes of idle, but if the screen is locked I want the screen off after a shorter period of time. It may be a niche use case I don't know

shadowburst avatar Jun 26 '25 06:06 shadowburst

listener {
    timeout = 900 # 5mins
    on-timeout = hyprctl dispatch dpms off
    on-resume = hyprctl dispatch dpms on
}

dpms is what you're looking for

dalpax avatar Jun 26 '25 06:06 dalpax

I already had this in my hypridle config :

listener {
    timeout = 300 # 5mins
    on-timeout = "hyprctl dispatch dpms off"
    on-resume = "hyprctl dispatch dpms on"
}

What I mean is to be able to do this :

listener {
    timeout = 15
    on-timeout = "[[ $(qs ipc call lock status) == 'locked' ]] && hyprctl dispatch dpms off"
    on-resume = "hyprctl dispatch dpms on"
}

Where lock status returns whether or not the lock screen is active

shadowburst avatar Jun 26 '25 11:06 shadowburst

I already had this in my hypridle config :

listener {
    timeout = 300 # 5mins
    on-timeout = "hyprctl dispatch dpms off"
    on-resume = "hyprctl dispatch dpms on"
}

What I mean is to be able to do this :

listener {
    timeout = 15
    on-timeout = "[[ $(qs ipc call lock status) == 'locked' ]] && hyprctl dispatch dpms off"
    on-resume = "hyprctl dispatch dpms on"
}

Where lock status returns whether or not the lock screen is active

So basically you want an ipc handler to return the lock status? I can do this pretty easily if you want it

soramanew avatar Jun 26 '25 11:06 soramanew

Awesome thank you very much !

shadowburst avatar Jun 26 '25 16:06 shadowburst