modules/hyprspace: better reload handling
This commit is contained in:
parent
a9abf38ab1
commit
c626e30976
1 changed files with 3 additions and 5 deletions
|
@ -54,7 +54,8 @@ in {
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = "5s";
|
RestartSec = "5s";
|
||||||
ExecStart = "${hyprspace}/bin/hyprspace up hyprspace -f -c ${runConfig}";
|
ExecStart = "${hyprspace}/bin/hyprspace up hyprspace -f -c ${runConfig}";
|
||||||
ExecStop = "${hyprspace}/bin/hyprspace down hyprspace";
|
ExecStop = "${hyprspace}/bin/hyprspace down hyprspace -c ${runConfig}";
|
||||||
|
ExecReload = "${pkgs.coreutils}/bin/kill -USR1 $MAINPID";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
|
@ -68,10 +69,7 @@ in {
|
||||||
PATH=${pkgs.systemd}/bin:$PATH
|
PATH=${pkgs.systemd}/bin:$PATH
|
||||||
case $1 in
|
case $1 in
|
||||||
wl*|en*)
|
wl*|en*)
|
||||||
if systemctl is-active hyprspace.service; then
|
systemctl reload-or-restart --no-block hyprspace.service;;
|
||||||
${builtins.concatStringsSep "\n" (map (peer: "/run/wrappers/bin/ping -qnA -c3 -W1 ${peer} && exit") (builtins.attrNames peers))}
|
|
||||||
fi
|
|
||||||
systemctl restart --no-block hyprspace.service;;
|
|
||||||
esac
|
esac
|
||||||
exit 0
|
exit 0
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Add table
Reference in a new issue