hyprwm / hypridle

Hyprland's idle daemon
BSD 3-Clause "New" or "Revised" License
404 stars 25 forks source link

automatic reload #70

Closed Atemu closed 5 months ago

Atemu commented 5 months ago

Currently, in order for a change in the hypridle config to apply, one must kill the daemon and re-run it.

It'd be great if hypridle would automatically reload the config when it changes; just like Hyprland.

vaxerski commented 5 months ago

no point, restarting it is trivial

Atemu commented 5 months ago

Not quite, one must resort to hacks like nohup which is annoying to deal with as it litters every directory with .nohup files unless you do the nohup ... > /dev/null dance.

Or is there some other method I'm missing?

vaxerski commented 5 months ago

killall hypridle && hypridle&disown

Atemu commented 5 months ago

That's a good bit better.

Though I'd still like auto reload for the convenience alone.

vaxerski commented 5 months ago

write a script to get the last modified date every second and execute above if it changes?

Atemu commented 5 months ago

Sure you could do that but at that point you might aswell use a service manager...

vaxerski commented 5 months ago

you know that's precisely how it works in hyprland though? xD

Atemu commented 5 months ago

Sorry, I'm not following; how what works in Hyprland?

vaxerski commented 5 months ago

auto-reload. It stats the files every second and reloads if modified date changed

Atemu commented 5 months ago

Ah, yes of course that's how it'd have to work. Though in this case, it'd be integrated into the daemon itself and merely "reloads" rather than tearing everything down and bringing it up again. In the case of Hyprland, tearing it down is simply not possible without user interruption, so that's the only solution while here we can simply restart the daemon without any loss to the user.