From 52970b1bdb37aaf043c10a151b3ae6f680c174b1 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 13 May 2026 13:43:19 +0100 Subject: refactor(sway): manage waybar via systemd user service Move waybar from sway's inline bar {} block to waybar.service pulled in by sway-session.target. Matches the pattern for mako, swayidle, poweralertd, display-watcher, cliphist. ExecReload sends SIGUSR2 so 'systemctl --user reload waybar' picks up config changes without a restart. --- dot_config/systemd/user/sway-session.target | 2 +- dot_config/systemd/user/waybar.service | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 dot_config/systemd/user/waybar.service (limited to 'dot_config/systemd/user') diff --git a/dot_config/systemd/user/sway-session.target b/dot_config/systemd/user/sway-session.target index 0c33a40..0b1166c 100644 --- a/dot_config/systemd/user/sway-session.target +++ b/dot_config/systemd/user/sway-session.target @@ -2,6 +2,6 @@ Description=sway compositor session Documentation=man:systemd.special(7) BindsTo=graphical-session.target -Wants=graphical-session-pre.target mako.service poweralertd.service display-watcher.service swayidle.service cliphist-text.service cliphist-image.service +Wants=graphical-session-pre.target mako.service poweralertd.service display-watcher.service swayidle.service cliphist-text.service cliphist-image.service waybar.service After=graphical-session-pre.target StopWhenUnneeded=yes diff --git a/dot_config/systemd/user/waybar.service b/dot_config/systemd/user/waybar.service new file mode 100644 index 0000000..fb3a29e --- /dev/null +++ b/dot_config/systemd/user/waybar.service @@ -0,0 +1,16 @@ +[Unit] +Description=Waybar status bar for sway +PartOf=graphical-session.target +After=graphical-session.target +ConditionEnvironment=WAYLAND_DISPLAY + +[Service] +Type=simple +ExecStart=/usr/bin/waybar +ExecReload=/bin/kill -SIGUSR2 $MAINPID +Restart=on-failure +RestartSec=2s +KillMode=mixed + +[Install] +WantedBy=sway-session.target -- cgit v1.3.1