This commit is contained in:
soraefir
2026-08-19 19:47:06 +02:00
parent 58492cae22
commit fd14b7f64d
2 changed files with 61 additions and 12 deletions
+12 -2
View File
@@ -2,6 +2,16 @@
let
ensureDaemon = pkgs.custom.eww-ensure-daemon;
ewwCleanStart = pkgs.writeShellScript "eww-clean-start" ''
uid="$(${pkgs.coreutils}/bin/id -u)"
runtime_dir="''${XDG_RUNTIME_DIR:-/run/user/$uid}"
${pkgs.procps}/bin/pkill -TERM -x -u "$uid" eww >/dev/null 2>&1 || true
${pkgs.coreutils}/bin/sleep 0.2
${pkgs.procps}/bin/pkill -KILL -x -u "$uid" eww >/dev/null 2>&1 || true
${pkgs.coreutils}/bin/rm -f "$runtime_dir"/eww-server_*
'';
openOnCurrentScreen = pkgs.writeShellScriptBin "eww-open-on-current-screen" ''
window="$1"
shift
@@ -75,9 +85,9 @@ in {
};
Service = {
Type = "simple";
ExecStartPre = "${pkgs.bash}/bin/bash -c 'rm -f \"\${XDG_RUNTIME_DIR:-/run/user/$(id -u)}\"/eww-server_*'";
ExecStartPre = "${ewwCleanStart}";
ExecStart = "${lib.getExe pkgs.eww} daemon --no-daemonize";
Restart = "on-failure";
Restart = "always";
RestartSec = 1;
};
Install.WantedBy = [ "graphical-session.target" ];