mylinuxforwork / dotfiles

The ML4W Dotfiles for Hyprland - An advanced and full-featured configuration for the dynamic tiling window manager Hyprland including an easy to use installation script for Arch based Linux distributions.
GNU General Public License v3.0
1.07k stars 80 forks source link

[BUG] Hyprlock Displays Desktop #248

Open jigypeper opened 2 months ago

jigypeper commented 2 months ago

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):

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

mylinuxforwork commented 2 months ago

@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?

jigypeper commented 2 months ago

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. }

daniij commented 1 month ago

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.

mylinuxforwork commented 1 month ago

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

mylinuxforwork commented 1 month ago

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

jigypeper commented 1 month ago

didn't work for me :(

xsylic commented 1 month ago

I'm getting the same problem.