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 <noreply@anthropic.com>
This commit is contained in:
parent
53c9abb11a
commit
0b9f981ed2
1 changed files with 17 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue