dotfiles/dot_local/bin/executable_zellijList
2024-09-29 20:36:15 +02:00

10 lines
239 B
Bash

#!/usr/bin/env bash
ZJ_SESSIONS=$(zellij list-sessions)
NO_SESSIONS=$(echo "${ZJ_SESSIONS}" | wc -l)
if [ "${NO_SESSIONS}" -ge 2 ]; then
zellij attach \
"$(echo "${ZJ_SESSIONS}" | fzf | cut -d' ' -f1)"
else
zellij attach -c
fi