create mango-session.target

This commit is contained in:
Ray Elliott 2026-03-04 19:58:39 +00:00
commit e7b71de3d8
14 changed files with 137 additions and 8 deletions

View file

@ -1,15 +1,19 @@
# Waybar is attached to mango-session.target instead of default.target to avoid
# startup races in TTY-launched Wayland sessions. The target is started only
# after mango exports WAYLAND_DISPLAY/DBUS env into systemd --user.
[Unit]
Description=Waybar
Documentation=man:waybar(5)
After=default.target
PartOf=default.target
PartOf=mango-session.target
[Service]
Type=simple
# Guard against rare timing jitter: do not exec waybar until the compositor
# socket actually exists for the display advertised in user-manager env.
ExecStartPre=/usr/bin/sh -c 'until [ -n "$WAYLAND_DISPLAY" ] && [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; do sleep 0.2; done'
ExecStart=/usr/bin/waybar
Restart=on-failure
RestartSec=1
[Install]
WantedBy=default.target
WantedBy=mango-session.target