engstrand-config / dwl-guile

Dynamic tiling Wayland compositor configurable in Guile Scheme, based on dwl and libguile - now with a REPL!
Other
97 stars 5 forks source link

Invoke startup hook just once #39

Closed ghost closed 11 months ago

ghost commented 11 months ago

I use the dwl:hook-startup in my configuration to manually start the Shepherd daemon so that home services like kanshi are initialized after the compositor. However, doing this causes the dwl-guile daemon to break upon reconfiguration. My first thought was to get the PID, persist it in a variable and check if this exists in further reconfigurations, but I'm not sure how to go about this via dwl:spawn. AFAICT, you work around this in your config by using custom Shepherd services that have a requirement of dwl-guile, but tackling this would be useful for people that don't use RDE/don't want to override features.

Frewacom commented 11 months ago

Hi,

The startup hook is only called once during startup, and will not be called again, even if you reload the config (from what I can see).

Are you sure that your startup hook callbacks are called again on reconfigure?

ghost commented 11 months ago

Yes, my bad, apologies. It seems that using a program-file inside the callback caused some weird quirks. I've now reworked it to use dwl:spawn and it works as expected.

Frewacom commented 11 months ago

No worries!