mirror of
https://github.com/outbackdingo/hyprcosmic-session.git
synced 2026-08-25 14:53:23 +00:00
The greeter starts this script with what pam and systemd put in the environment and nothing else. start-cosmic re-execs itself through $SHELL to pick up /etc/profile and the user's login files; not doing the same here is why the two sessions disagreed about the environment. Measured here, the difference is XDG_DATA_DIRS: empty without this, and with it the two flatpak exports directories that hold the .desktop files and icons the launcher reads. PATH is unchanged either way -- /etc/profile only appends what is missing. Differs from upstream in two ways. The recursion guard is an exported variable rather than a positional --in-login-shell flag, because a flag has to survive being quoted through another shell to be seen on the way back in, and if it ever failed to, the login would hang instead of failing; an exported variable survives exec by definition. And it uses bash's own `exec -l` rather than an extra `bash -c` hop, since this script is already bash. First in the file, deliberately: the login files may set XDG_CACHE_HOME, which is where the log goes, so this happens while there is nothing to lose. Verified the log still rotates exactly once per login. see: https://github.com/pop-os/cosmic-session/issues/23