22 lines
661 B
Plaintext
Raw Permalink Normal View History

2015-03-24 12:26:49 +01:00
#!/bin/bash
# GNU Screen stuff
if (command -v tmux &>/dev/null); then
if [ "$(pgrep -u "$UID" "tmux" | wc -l)" -gt 0 ]; then
if [[ $TERM != screen* ]]; then
2015-03-24 12:26:49 +01:00
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")
2015-03-24 12:26:49 +01:00
echo_info "Found ${nb_sessions} tmux session(s)"
2015-03-24 12:26:49 +01:00
echo " * ${nb_sessions_attached} attached"
tmux list-sessions | grep "attached" | sed -e 's/^/ - /'
echo " * ${nb_sessions_detached} detached"
tmux list-sessions | grep -v "attached" | sed -e 's/^/ - /'
fi
fi
fi