These files are always sourced (never executed directly), so the #!/bin/bash shebang is inert and misleading. Drop it consistently across rc.d/*, profile.d/*, and aliases.d/*.
20 lines
676 B
Plaintext
20 lines
676 B
Plaintext
# GNU Screen stuff
|
|
if (command -v tmux &>/dev/null); then
|
|
if [ "$(pgrep -u "$UID" "tmux" | wc -l)" -gt 0 ]; then
|
|
if [[ $TERM != screen* ]]; then
|
|
nb_sessions=$(tmux list-session | wc -l)
|
|
nb_sessions_attached=$(tmux list-session | grep -c "attached")
|
|
nb_sessions_detached=$(tmux list-session | grep -c -v "attached")
|
|
|
|
echo_info "tmux : found ${nb_sessions} session(s)"
|
|
|
|
echo "➤ ${nb_sessions_attached} session(s) attached"
|
|
tmux list-sessions | grep "attached" | sed -e 's/^/ • /'
|
|
|
|
echo "➤ ${nb_sessions_detached} session(s) detached"
|
|
tmux list-sessions | grep -v "attached" | sed -e 's/^/ • /'
|
|
|
|
fi
|
|
fi
|
|
fi
|