feat: zellij use systemd-run

This commit is contained in:
Gerg-L 2025-05-31 12:56:33 -04:00
parent a3246d5297
commit bfe9645bc2
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI

View file

@ -24,12 +24,20 @@
}; };
in in
'' ''
run_zellij () {
if ! systemctl is-active --quiet --user "zellij$2.scope"; then
systemd-run --scope --unit="zellij$2" --user zellij attach -b "$1"
fi
zellij attach "$1"
}
if [[ -z "$ZELLIJ" ]]; then if [[ -z "$ZELLIJ" ]]; then
if [[ -n "$SSH_TTY" ]]; then if [[ -n "$SSH_TTY" ]]; then
zellij attach -c "SSH@$USER" run_zellij "$SSH@$USER" ""
else else
MONITOR="$(${monitorScript} || true)" MONITOR="$(${monitorScript} || true)"
zellij attach -c "''${MONITOR:+"$MONITOR@"}$USER" run_zellij "''${MONITOR:+"$MONITOR@"}$USER" "-''${MONITOR:+"$MONITOR"}"
fi fi
fi fi
''; '';