From 0b9f981ed2059ec95265771a9e0c9d7baed71fd4 Mon Sep 17 00:00:00 2001 From: rope Date: Tue, 26 May 2026 17:30:13 +0100 Subject: [PATCH] quickshell: run as systemd service, auto-restart on config change Replace hl.exec_cmd("qs") with a systemd user service bound to hyprland-session.target. xdg.configFile onChange restarts the service when the QML config changes during a rebuild. Co-Authored-By: Claude Opus 4.6 --- settings/hyprland.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/settings/hyprland.nix b/settings/hyprland.nix index e67f91a..0e45727 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -239,7 +239,6 @@ in -- Ensure hyprland-session.target starts even if HM's -- dbus-update-activation-environment chain fails upstream. hl.exec_cmd("systemctl --user start hyprland-session.target") - hl.exec_cmd("qs") hl.exec_cmd("mako") hl.exec_cmd("wl-paste --type text --watch cliphist store") @@ -428,7 +427,24 @@ in # Hyprland session so they don't crash-loop in a GNOME session. wayland.systemd.target = "hyprland-session.target"; + systemd.user.services.quickshell = { + Unit = { + Description = "Quickshell desktop shell"; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + Service = { + ExecStart = "${pkgs.quickshell}/bin/qs"; + Restart = "on-failure"; + RestartSec = 2; + }; + Install.WantedBy = [ "hyprland-session.target" ]; + }; + xdg.configFile."quickshell/shell.qml" = { + onChange = '' + ${pkgs.systemd}/bin/systemctl --user restart quickshell.service 2>/dev/null || true + ''; text = '' //@ pragma UseQApplication import Quickshell