fix(waybar): launch from exec-once, not a systemd user service
Waybar vanished after a logout→login (no reboot): the bar's systemd user service landed in `failed`. HM's Hyprland integration cycles hyprland-session.target on every launch (exec-once stop && start), which re-pulls WantedBy units — including waybar.service — very early, before Hyprland's IPC socket is ready. Waybar's hyprland/workspaces & window modules can't connect, so it exits non-zero and is never retried. A cold boot's extra latency hid the race, so it only bit on warm relogins. The non-IPC session services (swaync/hypridle/hyprsunset) survive the same cycling fine, which is why night-light kept working. Launch waybar from Hyprland's own exec-once instead (systemd.enable = false). exec-once entries are dispatched once the compositor is up, so the IPC socket is ready — the same reliable pattern awww-daemon, the wallpaper sync and the keyboard watcher already use across relogins. Since the unit no longer exists to be restarted on a home-manager switch, nudge the running bar to re-read its rebuilt config/style with SIGUSR2 from nomarchy-theme-sync so theme switches still reapply the bar live. Found on the Latitude 5410 hardware sweep (systemctl --user status showed waybar.service loaded/failed; manual start worked). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -228,7 +228,14 @@ in
|
||||
{
|
||||
programs.waybar = lib.mkIf config.nomarchy.waybar.enable {
|
||||
enable = true;
|
||||
systemd.enable = true; # started/stopped with graphical-session.target
|
||||
# Launched from Hyprland's exec-once (hyprland.nix), NOT a systemd user
|
||||
# service. Bound to graphical-session.target the unit raced Hyprland's IPC
|
||||
# on a warm relogin — it started before the socket was up, exited, landed
|
||||
# in `failed`, and was never retried, so the bar vanished. exec-once only
|
||||
# fires once Hyprland is up, dodging the race; theme switches reload the
|
||||
# running bar via SIGUSR2 (nomarchy-theme-sync). No uwsm here to manage the
|
||||
# session target, so we don't depend on its lifecycle.
|
||||
systemd.enable = false;
|
||||
|
||||
# mkDefault so downstream can replace the whole bar config/style with
|
||||
# a plain home.nix assignment. For per-theme identity, prefer the
|
||||
|
||||
Reference in New Issue
Block a user