hyprwm / hyprlock

Hyprland's GPU-accelerated screen locking utility
BSD 3-Clause "New" or "Revised" License
803 stars 59 forks source link

Manual configuration used to disable display on clamshell breaks hyprlock #480

Open svin24 opened 1 month ago

svin24 commented 1 month ago

Regression?

No

Hyprlock Info and Version

v0.4.1

Hyprlock config ```sh background { path = screenshot #path = /megumin/Wallpapers/Other/plants-1.jpg blur_passes = 3 blur_size = 3 noise = 0.0117 contrast = 0.8916 brightness = 0.2 vibrancy = 0.1696 vibrancy_darkness = 0.5 } input-field { size = 200, 50 outline_thickness = 3 dots_size = 0.33 # Scale of input-field height, 0.2 - 0.8 dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0 dots_center = false dots_rounding = -2 # -1 default circle, -2 follow input-field rounding outer_color = rgb(15,15,15) inner_color = rgb(200, 200, 200) font_color = rgb(10, 10, 10) fade_on_empty = true fade_timeout = 1000 # Milliseconds before fade_on_empty is triggered. # placeholder_text = Input Password... hide_input = false rounding = 0 check_color = rgb(0, 0, 0) fail_color = rgb(204, 34, 34) # if authentication failed, changes outer_color and fail message color fail_text = $FAIL ($ATTEMPTS) # can be set to empty fail_transition = 300 # transition time in ms between normal outer_color and fail_color capslock_color = -1 numlock_color = -1 bothlock_color = -1 # when both locks are active. -1 means don't change outer color (same for above) invert_numlock = false # change color if numlock is off position = 0, -20 halign = center valign = center } label { text = cmd[update:1000] echo "$(date "+%A %d/%m %H:%M")" color = rgba(200, 200, 200, 1.0) font_size = 25 font_family = IBM Plex Mono position = 0, 80 halign = center valign = center } ```

Compositor Info and Version

System/Version info ```sh Hyprland, built from branch at commit 9a09eac79b85c846e3a865a9078a3f8ff65a9259 (props: bump version to 0.42.0). Date: Wed Aug 7 19:17:10 2024 Tag: v0.42.0, commits: 5069 flags: (if any) System Information: System name: Linux Node name: holobook Release: 6.10.6-200.fc40.x86_64 Version: #1 SMP PREEMPT_DYNAMIC Mon Aug 19 14:09:30 UTC 2024 GPU information: 04:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Lucienne [1002:164c] (rev c1) (prog-if 00 [VGA controller]) os-release: NAME="Fedora Linux" VERSION="40 (KDE Plasma)" ID=fedora VERSION_ID=40 VERSION_CODENAME="" PLATFORM_ID="platform:f40" PRETTY_NAME="Fedora Linux 40 (KDE Plasma)" ANSI_COLOR="0;38;2;60;110;180" LOGO=fedora-logo-icon CPE_NAME="cpe:/o:fedoraproject:fedora:40" DEFAULT_HOSTNAME="fedora" HOME_URL="https://fedoraproject.org/" DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f40/system-administrators-guide/" SUPPORT_URL="https://ask.fedoraproject.org/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Fedora" REDHAT_BUGZILLA_PRODUCT_VERSION=40 REDHAT_SUPPORT_PRODUCT="Fedora" REDHAT_SUPPORT_PRODUCT_VERSION=40 SUPPORT_END=2025-05-13 VARIANT="KDE Plasma" VARIANT_ID=kde plugins: ```

Description

This issue is a continuation from hyprland https://github.com/hyprwm/Hyprland/issues/7629

my configuration used to disable the display when the lid closes ends up breaking hyprlock, I don't think any input other than the mouse is being registered.

How to reproduce

LAPTOP LID STUFF

bindl=,switch:on:Lid Switch,exec,hyprctl keyword monitor "eDP-1, disable" bindl=,switch:off:Lid Switch,exec,hyprctl keyword monitor "eDP-1, 1920x1080, 0x0, 1.2"



- make sure its not connected to any external displays(undock it)
- close the lid, wait a couple of seconds.
- re open the lid

At this point the only way i have found to recover the system is using TTY to kill hyprland, `loginctl unlocksession X` does not seem to work.

### Crash reports, logs, images, videos

![IMG_20240904_210823](https://github.com/user-attachments/assets/720c89c1-b55a-4a7c-b72e-3fb2eb94d34a)

after testing it I found the screen turns red regardless of if you use a screenshot or a path to an image.
svin24 commented 1 month ago
Hypridle config ```sh general { lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances. before_sleep_cmd = loginctl lock-session # lock before suspend. after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. } listener { timeout = 150 # 2.5min. on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor. on-resume = brightnessctl -r # monitor backlight restore. } listener { timeout = 300 # 5min on-timeout = loginctl lock-session # lock screen when timeout has passed } listener { timeout = 310 # 5.5min on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired. } ```

I decided to post my hypridle config too if it helps.

PaideiaDilemma commented 1 month ago

~dupe of #434~

To fix it make sure you update aquamarine to 0.4.0. If you can't yet put monitor=FALLBACK,1920x1080@60,auto,1 in your config for now

svin24 commented 1 month ago

@PaideiaDilemma I am using aquamarine 0.4.0 even tried hyprland-git which just gave me an error screen instead of a red screen, not sure how to set up the monitor=FALLBACK thing. I can't even find documentation on that anywhere.

PaideiaDilemma commented 1 month ago

not sure how to set up the monitor=FALLBACK thing

monitor=FALLBACK,1920x1080@60,auto,1 is just a monitor config for hyprland. You have even posted such configurations in your original bug report.

Please add this line and let us know if that fixed it.

I am using aquamarine 0.4.0

Are you sure about that??? I am not sure if it is on Fedora 40 yet.

svin24 commented 1 month ago

monitor=FALLBACK,1920x1080@60,auto,1 is just a monitor config for hyprland. You have even posted such configurations in your original bug report. Please add this line and let us know if that fixed it.

I added it like this


monitor=FALLBACK,1920x1080@60,auto,1
monitor=eDP-1, 1920x1080, 0x0, 1.2
monitor=HDMI-A-1, 1920x1080@60, -1920x-600, 1

# LAPTOP LID STUFF
bindl=,switch:on:Lid Switch,exec,hyprctl keyword monitor "eDP-1, disable"
bindl=,switch:off:Lid Switch,exec,hyprctl keyword monitor "eDP-1, 1920x1080, 0x0, 1.2"

And it did nothing. I just assumed you needed to set FALLBACK somehow to be a specific display, but now I assume it just creates some kind of false display? Anyway, red screen again.

Are you sure about that??? I am not sure if it is on Fedora 40 yet.

yes that is the version of aquamarine provided by the copr https://copr.fedorainfracloud.org/coprs/solopasha/hyprland and the version that appears when i use dnf info aquamarine

PaideiaDilemma commented 1 month ago

Then you have a different issue. Can you try hyprlock-git please?

svin24 commented 1 month ago

Just compiled and tried it. Same thing unfortunately.

I don't mind building a debug version of it however I don't know where the logs are located

EDIT: ok found a way to do it and got a log lock.log

PaideiaDilemma commented 1 month ago

Can you try to get a debug trace??

svin24 commented 1 month ago

that log I got was with the debug build. Unless I am doing it wrong somehow.

If you can explain to me how to do that I will.

PaideiaDilemma commented 1 month ago

You reproduce the crash with the debug build and then use coredumpctl info. That should print a summary containing a backtrace. If you can please post that.