# 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) 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=mango-session.target