1
0
Fork 0
mirror of https://github.com/Horhik/dotfiles.git synced 2024-11-09 10:23:11 +00:00
Dotfiles/.config/polybar/themes/monolit-dracula/polybar-scripts/info-tmux-sessions/info-tmux-sessions.sh
2020-09-05 14:43:37 +03:00

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