diff --git a/config/dot/hypr/autostart.lua b/config/dot/hypr/autostart.lua index af3fc6e..c2a03a5 100644 --- a/config/dot/hypr/autostart.lua +++ b/config/dot/hypr/autostart.lua @@ -47,18 +47,22 @@ hl.on("hyprland.start", function() -- Keyring unlock, for Nextcloud and Bitwarden credential storage. hl.exec_cmd("/usr/bin/gnome-keyring-daemon --start --components=secrets,ssh,pkcs11") - -- Tray applications carried over from ~/.config/autostart. These need the - -- Quickshell tray (an SNI host) to be up, hence starting after it. + -- Nextcloud and Bitwarden are NOT started here. Both ship a + -- ~/.config/autostart/*.desktop entry, and systemd's own + -- systemd-xdg-autostart-generator turns every such entry into a + -- `PartOf=graphical-session.target` unit (`app-Nextcloud@autostart.service`, + -- `app-com.bitwarden.desktop@autostart.service`) that fires once the uwsm + -- session brings up graphical-session.target -- confirmed live via + -- `systemctl --user list-units 'app-*@autostart.service'`. An explicit + -- second launch here used to duplicate that: for Bitwarden specifically, + -- each `flatpak run` gets its own sandbox instance, so the two starts + -- didn't just race, they left two competing processes fighting over the + -- app's single-instance lock, with neither reliably owning a usable + -- window. Trust the generator instead of re-launching. -- - -- Commands are copied verbatim from the GNOME .desktop files rather than - -- guessed: Bitwarden is a flatpak with no `bitwarden` binary on PATH, and - -- its autostart entry launches a specific script with --autostart. - -- - -- RustDesk is deliberately absent: it ships an enabled *system* service - -- (`rustdesk --service`) that spawns --server and --tray for the session on - -- its own. Starting it here as well would give you two trays. - hl.exec_cmd("nextcloud --background") - hl.exec_cmd("flatpak run --command=bitwarden.sh com.bitwarden.desktop --autostart") + -- RustDesk is deliberately absent too: it ships an enabled *system* + -- service (`rustdesk --service`) that spawns --server and --tray for the + -- session on its own. Starting it here as well would give you two trays. end) hl.on("hyprland.shutdown", function()