mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-09 16:33:57 -05:00
feat: zellij use systemd-run
This commit is contained in:
parent
a3246d5297
commit
bfe9645bc2
1 changed files with 10 additions and 2 deletions
|
|
@ -24,12 +24,20 @@
|
|||
};
|
||||
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 [[ -n "$SSH_TTY" ]]; then
|
||||
zellij attach -c "SSH@$USER"
|
||||
run_zellij "$SSH@$USER" ""
|
||||
else
|
||||
MONITOR="$(${monitorScript} || true)"
|
||||
zellij attach -c "''${MONITOR:+"$MONITOR@"}$USER"
|
||||
run_zellij "''${MONITOR:+"$MONITOR@"}$USER" "-''${MONITOR:+"$MONITOR"}"
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue