uwsm: autostart services don't inherit env vars from compositor

I have this in my hyprland config file:

$cursor-theme = capitaine-cursors
$cursor-size = 48
env = XCURSOR_SIZE,$cursor-size
env = XCURSOR_THEME,$cursor-theme
exec = hyprctl setcursor $cursor-theme $cursor-size
exec = gsettings set org.gnome.desktop.interface cursor-theme $cursor-theme
exec = gsettings set org.gnome.desktop.interface cursor-size $cursor-size
exec = uwsm finalize XCURSOR_THEME XCURSOR_SIZE

I have corectrl set up as an autostart service, which ends up using the wrong cursor. Could it be because autostart services are started before the compositor signals readiness? I checked the environment variables like this: cat /proc/$(pidof corectrl)/environ | tr '\0' '\n'

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 29 (29 by maintainers)

Most upvoted comments

I built Hyprland from source and removed the calls to sd_notify():

diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index ab478a87..21c44687 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -342,11 +342,6 @@ void CCompositor::cleanup() {
     m_bIsShuttingDown   = true;
     Debug::shuttingDown = true;
 
-#ifdef USES_SYSTEMD
-    if (sd_booted() > 0)
-        sd_notify(0, "STOPPING=1");
-#endif
-
     // unload all remaining plugins while the compositor is
     // still in a normal working state.
     g_pPluginSystem->unloadAllPlugins();
@@ -539,14 +534,6 @@ void CCompositor::startCompositor() {
 
     g_pHyprRenderer->setCursorFromName("left_ptr");
 
-#ifdef USES_SYSTEMD
-    if (sd_booted() > 0)
-        // tell systemd that we are ready so it can start other bond, following, related units
-        sd_notify(0, "READY=1");
-    else
-        Debug::log(LOG, "systemd integration is baked in but system itself is not booted à la systemd!");
-#endif
-
     createLockFile();
 
     // This blocks until we are done.

Now everything works as expected 🎉