From 19fc0917c0510f2191e4b6024a7d4d6190fabbf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Sun, 2 May 2021 05:26:10 +0900 Subject: [PATCH] waybar: fix systemd service Fix xdg-portal issue where it'd take 25s for a GTK app to start --- modules/programs/waybar.nix | 7 +++---- .../waybar/systemd-with-graphical-session-target.service | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/programs/waybar.nix b/modules/programs/waybar.nix index bf63dcc7b..3cf919cc7 100644 --- a/modules/programs/waybar.nix +++ b/modules/programs/waybar.nix @@ -370,14 +370,13 @@ in { "Highly customizable Wayland bar for Sway and Wlroots based compositors."; Documentation = "https://github.com/Alexays/Waybar/wiki"; PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; }; Service = { - Type = "dbus"; - BusName = "fr.arouillard.waybar"; ExecStart = "${cfg.package}/bin/waybar"; - Restart = "always"; - RestartSec = "1sec"; + ExecReload = "kill -SIGUSR2 $MAINPID"; + Restart = "on-failure"; KillMode = "mixed"; }; diff --git a/tests/modules/programs/waybar/systemd-with-graphical-session-target.service b/tests/modules/programs/waybar/systemd-with-graphical-session-target.service index 9bdcf78c4..e03326e6e 100644 --- a/tests/modules/programs/waybar/systemd-with-graphical-session-target.service +++ b/tests/modules/programs/waybar/systemd-with-graphical-session-target.service @@ -2,14 +2,13 @@ WantedBy=graphical-session.target [Service] -BusName=fr.arouillard.waybar +ExecReload=kill -SIGUSR2 $MAINPID ExecStart=@waybar@/bin/waybar KillMode=mixed -Restart=always -RestartSec=1sec -Type=dbus +Restart=on-failure [Unit] +After=graphical-session.target Description=Highly customizable Wayland bar for Sway and Wlroots based compositors. Documentation=https://github.com/Alexays/Waybar/wiki PartOf=graphical-session.target