ssh libnotify forward

This commit is contained in:
ari committed 2026-07-19 09:25:55 -04:00
1 parent 26bcf95f30
commit 0fa5c3bc68
1 file changed
+16 -14
+16 -14
View File
@@ -71,20 +71,22 @@ in
after = [ "default.target" ];
wantedBy = [ "default.target" ];
serviceConfig = {
ExecStart = let
listenerScript = pkgs.writeShellScript "ssh-notify-listener" ''
set -euo pipefail
# Remove stale socket if present
rm -f ${socketPath}
# Listen and for each connection read two lines (title line, body line)
# and invoke the real notify-send. We keep it running via systemd Restart.
while true; do
${pkgs.socat}/bin/socat \
UNIX-LISTEN:${socketPath},fork,mode=0666 \
SYSTEM:'read title; read body; ${realNotifySend} "$title" "$body" || true'
done
'';
in "${listenerScript}";
ExecStart =
let
listenerScript = pkgs.writeShellScript "ssh-notify-listener" ''
set -euo pipefail
# Remove stale socket if present
rm -f ${socketPath}
# Listen and for each connection read two lines (title line, body line)
# and invoke the real notify-send. We keep it running via systemd Restart.
while true; do
${pkgs.socat}/bin/socat \
UNIX-LISTEN:${socketPath},fork,mode=0666 \
SYSTEM:'read title; read body; ${realNotifySend} "$title" "$body" || true'
done
'';
in
"${listenerScript}";
Restart = "always";
RestartSec = 2;
};