[SOLVED] Hyprsunset doesn't work when suspended

Hyprland version
PASTE YOUR HYPRLAND VERSION HERE (0.51.1), BETWEEN THE BACKTICKS. DO NOT REMOVE ANY FORMATTING.

Describe your issue / feature…

I had an issue the other day where my screen was dark for most of the day, when my hyprsunset config should be set up so that it’s bright for most of the day. After several tests, I think I’ve figured out the issue: hyprsunset doesn’t trigger profile changes while the computer is suspended.

I did a quick test with this config (it was about 6:50 PM):

max-gamma = 100

profile {
    time = 18:00
    temperature = 6000
    gamma = 1.0
}

profile {
    time = 18:54
    temperature = 2000
    gamma = 0.5
}

Then, I rebooted to make sure this config was active. Then, I closed my laptop and waited for 6:55. After opening the laptop, it was still bright: the second profile didn’t kick in.

It seems to work fine as long as my computer is open (not suspended). Is this a bug, or is there something I can change to fix this?

It should not work. This is expected in suspend. Thankfully.

Use uwsm to login. Enable/start hypridle as a user service. Then append to hypridle.conf after_sleep_cmd

&& systemctl --user restart hyprsunset

You should be good to go.

Looks like I got it to work! I installed gdm (GNOME Display Manager), so I have a nice login screen instead of the Arch tty. I added exec-once = hypridle to my hyprland.conf. Altogether, my hypridle.conf looks like this now:

#hypridle.conf
general {
    lock_cmd = pidof hyprlock || hyprlock  # avoid starting multiple hyprlock instances.
    before_sleep_cmd = hyprlock  # lock before suspend.
	after_sleep_cmd = systemctl --user restart hyprsunset  # make sure hyprsunset reloads after opening laptop
  # to avoid having to press a key twice to turn on the display.
}

After a couple more tests, everything works as I want it to! After opening my laptop, the new hyprsunset profile might take about 30 seconds to kick in, but it appears to work.

Thanks for the help!

Update - Turns out gdm broke a couple other things (see my post on the Arch forums). I uninstalled gdm, ran a quick test of hyprsunset, and hyprsunset still works properly. So I probably misunderstood @hyprm3 ‘s post, I guess you don’t need a display manager.

1 Like

Glad you sorted it out.

I don’t use a display manager to login because this is a single user machine. And in the unlikely event of using one, gdm would not be on my list. Anything gnome is not my cup of tea.
To be honest, I have not used any pre-fabricated DE for many years.

I have setup auto login and instruct uwsm to start the session. You will find instructions to follow here or there.

To apply minimal security access to hyprland I include
exec-once = hyprlock

But this just me. Your mileage may vary.