Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] unlock_cmd is not triggered. #79

Open
lvlick opened this issue Jul 19, 2024 · 5 comments
Open

[BUG] unlock_cmd is not triggered. #79

lvlick opened this issue Jul 19, 2024 · 5 comments

Comments

@lvlick
Copy link

lvlick commented Jul 19, 2024

I'm using arch, hypridle and hyprlock.
To lock the screen I use loginctl lock-session.

Currently the unlock_cmd is not being executed.
My config looks like this:

general {
    lock_cmd = pidof hyprlock || /home/miep/lock.sh
    unlock_cmd = /home/miep/unlock.sh
    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 = 10                                # 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.
}

# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight.
listener { 
    timeout = 10                                          # 2.5min.
    on-timeout = brightnessctl -sd rgb:kbd_backlight set 0 # turn off keyboard backlight.
    on-resume = brightnessctl -rd rgb:kbd_backlight        # turn on keyboard backlight.
}

listener {
    timeout = 20                                # 5min
    on-timeout = loginctl lock-session            # lock screen when timeout has passed
}

listener {
    timeout = 25                                 # 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.
}

listener {
    timeout = 1800                                # 30min
    on-timeout = systemctl suspend                # suspend pc
}
@bobby-the-epic
Copy link

I've been having the same issue. Sounds like a duplicate of #24.

@lvlick
Copy link
Author

lvlick commented Jul 19, 2024

Not sure if it's the same issue, as nothing crashes for me, it just doesn't get triggered. Neither hypridle, hyprland, nor hyprlock crash, at least according to console output.

@nonetrix
Copy link

nonetrix commented Sep 2, 2024

Same here not even this works :/

general {
    lock_cmd = $lock_cmd
    before_sleep_cmd = loginctl lock-session
    unlock_cmd = notify-send "unlock!"
}

@gdiShun
Copy link

gdiShun commented Oct 13, 2024

general {
    lock_cmd = wpctl set-mute @DEFAULT_AUDIO_SINK@ 1 && pidof hyprlock || hyprlock && loginctl unlock-session
    unlock_cmd = wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 
    before_sleep_cmd = loginctl lock-session
}

This works as a workaround(specifically the && loginctl unlock-session, but not sure why it's necessary.

@iamhrigved
Copy link

iamhrigved commented Nov 16, 2024

Same problem!

~/.config/hypr/hypridle.conf

general {
    lock_cmd = ~/.config/hypr/scripts/lock.sh
    unlock_cmd = hyprctl dispatch submap reset  # 😭 NOT WORKING !!!
    before_sleep_cmd = loginctl lock-session    # lock before suspend
    after_sleep_cmd = hyprctl dispatch dpms on
}

listener {
    timeout = 480                               # 8 min
    on-timeout = loginctl lock-session          # lock
}

listener {
    timeout = 600                               # 10 min
    on-timeout = hyprctl dispatch dpms off      # screen off
    on-resume = hyprctl dispatch dpms on
}

listener {
    timeout = 900                               # 15 mins
    on-timeout = systemctl suspend              # suspend
}

~/.config/hypr/scripts/lock.sh

#!/bin/zsh

hyprctl dispatch submap lockscreen # engage lockscreen keybinds

pidof hyprlock || hyprlock # engage hyprlock

hyprctl dispatch submap reset # reset the submap when hyprlock exits # 👈🏼 WORKAROUND!

~/.config/hypr/hyprlock.conf

source = colors.conf

general {
    ignore_empty_input = true
}

background {
    path = /home/hrigved/.cache/wallpaper-blur-dim
}
# TIME
label {
    monitor = 
    text = cmd[update:1000] echo "$(date +"%R")"
    color = $foreground
    font_size = 100
    font_family = JetBrainsMono Nerd Font ExtraBold
    position = 0, 400
    halign = center
    valign = center
}

# DATE
label {
    monitor =
    text = cmd[update:1000] echo "$(date +"%a, %d %b")"
    color = $foreground
    font_size = 22
    font_family = JetBrainsMono Nerd Font Bold
    position = 0, 300
    halign = center
    valign = center
}

# UPTIME
label {
    monitor =
    text = cmd[update:1000] echo "$(uptime -p | sed "s/u/U/")"
    color = $foreground
    font_size = 14
    font_family = JetBrainsMono Nerd Font
    position = 0, -500
    halign = center
    valign = center
}

# KEYBINDS LEGEND
label {
    monitor = 
    text = Shutdown  -> Win + S<br/>Reboot    -> Win + R<br/>Suspend   -> Win + U<br/>Exit      -> Win + X<br/>Hibernate -> Win + H
    color = $foreground
    font_size = 11
    font_family = JetBrainsMono Nerd Font Medium
    position = 50, 30
    halign = left
    valign = bottom
}

input-field {
    size = 200, 50
    outline_thickness = 2
    dots_size = 0.25
    dots_spacing = 0.15
    dots_center = true
    dots_rounding = -1 # -1 default circle, -2 follow input-field rounding
    outer_color = $foreground
    inner_color = $background
    font_color = $foreground
    fade_on_empty = true
    fade_timeout = 1500 # Milliseconds before fade_on_empty is triggered.
    placeholder_text = <i>Enter Password...</i> # Text rendered in the input box when it's empty.
    hide_input = false
    rounding = 15
    check_color = $color2
    fail_color = rgb(204, 34, 34) # if authentication failed, changes outer_color and fail message color
    fail_text = <i>$FAIL <b>($ATTEMPTS)</b></i> # can be set to empty
    fail_timeout = 2000 # milliseconds before fail_text and fail_color disappears
    fail_transition = 200 # transition time in ms between normal outer_color and fail_color
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants