dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

[BUG] Hyprlock Displays Desktop

Open jigypeper opened this issue 1 year ago • 7 comments

Describe the bug I don’t know if this happens to anyone else, but for me, if I close my laptop lid and open it up, hyperlock doesnt seem to engage for like half a second, I get to see the desktop and what was running before entering the password to actually unlock the screen. 🤔

To Reproduce Steps to reproduce the behavior:

  1. Close the laptop lid
  2. Open the laptop lid
  3. Hyprlock will engage but only after you get a glimpse of the desktop

Expected behavior Hyprlock should engage immediately, if someone else opens the laptop, they should not have a glimpse at whatever was running prior to you closing the lid.

Screenshots N/A

Distribution (please complete the following information):

  • EndeavourOS

Additional context This is running on a 2013 MacBook Air (pretty old machine, but Arch has brought it back to life).

jigypeper avatar Sep 14 '24 14:09 jigypeper

@jigypeper Can you try this? https://www.reddit.com/r/hyprland/comments/1cu67k1/how_i_can_setup_hyprlock_on_laptop_lid_clos/ And share your experiences?

mylinuxforwork avatar Sep 15 '24 07:09 mylinuxforwork

Any idea what i need to suspend? I've got: custom.conf: bindl=,switch:Lid Switch, exec, hyprlock hypridle.conf: general { lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances. before_sleep_cmd = hyprlock # lock before suspend. after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. }

jigypeper avatar Sep 15 '24 16:09 jigypeper

I have simmilar issue, I found a pretty simple solution, but I don't know how to change the action that is performed when closing the laptop lid. Here is a small script to run instead of systemctl suspend, so that hyprlock can open before going to sleep.

#!/bin/bash loginctl lock-session sleep 3 systemctl suspend Ml4W please reply where I can change the action when closing the lid.

Or how to add delay between before_sleep_cmd and suspend in hyprlidle, beacuse laptop instntly going to sleep and hyptlock dont have time to apper.

daniij avatar Sep 16 '24 16:09 daniij

@daniij can you check this https://wiki.hyprland.org/Configuring/Binds/#switches

mylinuxforwork avatar Sep 25 '24 15:09 mylinuxforwork

I have simmilar issue, I found a pretty simple solution, but I don't know how to change the action that is performed when closing the laptop lid. Here is a small script to run instead of systemctl suspend, so that hyprlock can open before going to sleep.

#!/bin/bash loginctl lock-session sleep 3 systemctl suspend Ml4W please reply where I can change the action when closing the lid.

Or how to add delay between before_sleep_cmd and suspend in hyprlidle, beacuse laptop instntly going to sleep and hyptlock dont have time to apper.

You can change the file here for testing: https://github.com/mylinuxforwork/dotfiles/blob/main/share/dotfiles/.config/hypr/hypridle.conf

Please share you're results because the file will be overwritten with the next update or you protect your changes with the hook.sh: https://github.com/mylinuxforwork/dotfiles/wiki/Hook-and-Post-Installation-Scripts#protecting-your-own-dotfiles-adjustments-with-hooksh

mylinuxforwork avatar Oct 05 '24 08:10 mylinuxforwork

didn't work for me :(

jigypeper avatar Oct 05 '24 14:10 jigypeper

I'm getting the same problem.

ghost avatar Oct 14 '24 00:10 ghost

Please reopen the issue again if this is still relevant.

mylinuxforwork avatar Jan 10 '26 18:01 mylinuxforwork