mirror of
https://github.com/Horhik/dotfiles.git
synced 2024-11-08 09:53:13 +00:00
22 lines
386 B
Bash
22 lines
386 B
Bash
|
#! /bin/sh
|
||
|
|
||
|
if sessionlist=$(tmux ls); then
|
||
|
printf "# "
|
||
|
|
||
|
echo "$sessionlist" | while read -r line; do
|
||
|
session=$(echo "$line" | cut -d ':' -f 1)
|
||
|
|
||
|
if echo "$line" | grep -q "(attached)"; then
|
||
|
status="(a)"
|
||
|
else
|
||
|
status=""
|
||
|
fi
|
||
|
|
||
|
printf "%s%s " "$session" "$status"
|
||
|
done
|
||
|
|
||
|
printf "\n"
|
||
|
else
|
||
|
printf "# none\n"
|
||
|
fi
|