Skip to content

Hyprlock crash during external monitor plugging #779

@39george

Description

@39george

Regression?

No

Hyprlock Info and Version

Hyprlock config
# BACKGROUND
background {
    monitor =
    path = ~/.config/hypr/hyprlock.png
    blur_passes = 2
    color = rgba(000000ff)  # fallback color (black in this case)
    contrast = 0.8916
    brightness = 0.8172
    vibrancy = 0.1696
    vibrancy_darkness = 0.0
}

# GENERAL
general {
    immediate_render = true
    grace = 0
}

# INPUT FIELD
input-field {
    monitor =
    size = 250, 60
    outline_thickness = 2
    dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8
    dots_spacing = 0.2 # Scale of dots' absolute size, 0.0 - 1.0
    dots_center = true
    outer_color = rgba(0, 0, 0, 0)
    inner_color = rgba(100, 114, 125, 0.4)
    font_color = rgb(200, 200, 200)
    fade_on_empty = false
    font_family = Noto Sans
    placeholder_text = <i><span foreground="##ffffff99">Enter Pass</span></i>
    hide_input = false
    position = 0, -225
    halign = center
    valign = center
}

# Time
label {
    monitor =
    text = cmd[update:1000] echo "<span>$(date +"%H:%M")</span>"
    color = rgba(216, 222, 233, 0.70)
    font_size = 130
    font_family = Noto Sans
    position = 0, 240
    halign = center
    valign = center
}

# Day-Month-Date
label {
    monitor =
    text = cmd[update:1000] echo -e "$(date +"%A, %d %B")"
    color = rgba(216, 222, 233, 0.70)
    font_size = 30
    font_family = Noto Sans
    position = 0, 105
    halign = center
    valign = center
}

# Profie-Photo
image {
    monitor =
    path = /home/george/.config/hypr/avatar.png
    border_color = 0xffdddddd
    border_size = 0
    size = 120
    rounding = -1
    rotate = 0
    reload_time = -1
    reload_cmd = 
    position = 0, -20
    halign = center
    valign = center
}

# USER
label {
    monitor =
    text = Hi, $USER
    color = rgba(216, 222, 233, 0.70)
    font_size = 25
    font_family = Noto Sans
    position = 0, -130
    halign = center
    valign = center
}

# CURRENT SONG
label {
    monitor =
    text = cmd[update:1000] echo "$(~/bin/utils/songdetail.sh)" 
    color = rgba(255, 255, 255, 0.7)
    font_size = 18
    font_family = JetBrains Mono Nerd, SF Pro Display Bold
    position = 0, 60
    halign = center
    valign = bottom
}

Compositor Info and Version

System/Version info
Hyprland 0.49.0 built from branch  at commit 9958d297641b5c84dcff93f9039d80a5ad37ab00  (version: bump to 0.49.0).
Date: Thu May 8 20:15:18 2025
Tag: v0.49.0, commits: 6098
built against:
 aquamarine 0.8.0
 hyprlang 0.6.3
 hyprutils 0.7.1
 hyprcursor 0.1.12
 hyprgraphics 0.1.3


no flags were set


System Information:
System name: Linux
Node name: thinkpad
Release: 6.14.6-arch1-1
Version: #1 SMP PREEMPT_DYNAMIC Fri, 09 May 2025 17:36:18 +0000


GPU information:
64:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Phoenix1 [1002:15bf] (rev dd) (prog-if 00 [VGA controller])


os-release: NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo


plugins:

Description

Got crash during plugging external monitor to laptop, plugged that monitor many times with the same hyprland & hyprlock configs, worked fine. I also have systemd service which runs during monitor plug/unplug to update hyprland monitor config, crash happened during that service execution.

How to reproduce

Create monitor_setup.sh script:

#!/usr/bin/env bash

# Check if HDMI is connected
if ! hyprctl monitors | grep -q "HDMI-A-1"; then
  # If HDMI not connected, check if eDP-1 is disabled
  if ! hyprctl monitors | grep -q "eDP-1"; then
    # Enable built-in display if it's disabled
    hyprctl keyword monitor "eDP-1, 1920x1200@60.00, 0x0, 1"
    notify-send "Monitor Mode" "Switched to built-in display (HDMI disconnected)"
    eww close-all && sleep 1 && eww open bar-win
    exit 0
  else
    notify-send "No external monitor detected"
  fi
  exit 0
fi

# Check current state (is eDP-1 disabled?)
if hyprctl monitors | grep -q "eDP-1"; then
  # Currently in EXTENDED mode → switch to EXTERNAL-ONLY mode
  hyprctl keyword monitor "eDP-1, disable"
  hyprctl keyword monitor "HDMI-A-1, 1920x1080@100.00, 0x0, 1" # Center external
  notify-send "Monitor Mode" "HDMI-A-1 Only (eDP-1 disabled)"
  eww close-all && eww open bar-win
else
  # Currently in EXTERNAL-ONLY mode → switch to EXTENDED mode
  hyprctl keyword monitor "eDP-1, 1920x1200@60.00, 0x0, 1"
  hyprctl keyword monitor "HDMI-A-1, 1920x1080@100.00, 1920x0, 1"
  notify-send "Monitor Mode" "Extended (eDP-1 + HDMI-A-1)"
  eww close-all && eww open-many bar-win bar-win-ext
fi

Create systemd service as --user:

[Unit]
Description=Monitor Hotplug Handler

[Service]
Type=oneshot
ExecStart=/home/user/.local/bin/utils/monitor-setup.sh
Environment=DISPLAY=:0
Environment=WAYLAND_DISPLAY=wayland-1

[Install]
WantedBy=default.target

Create udev rule:

ACTION=="change", SUBSYSTEM=="drm", ENV{HOTPLUG}=="1", TAG+="systemd", ENV{SYSTEMD_USER_WANTS}+="monitor-hotplug.service", RUN+="/bin/systemctl --user --no-block start monitor-hotplug.service"

Try to plug/unplug external monitor

Crash reports, logs, images, videos

crash.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions