Added tmux notifications in rc.d
This commit is contained in:
parent
ca385d911f
commit
dbd673e951
25
rc.d/tmux
Executable file
25
rc.d/tmux
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# GNU Screen stuff
|
||||||
|
if ( which tmux &> /dev/null )
|
||||||
|
then
|
||||||
|
if [ $(pgrep -c "tmux") -gt 0 ]
|
||||||
|
then
|
||||||
|
if [[ $TERM != screen* ]]
|
||||||
|
then
|
||||||
|
nb_sessions=$(tmux list-session | wc -l)
|
||||||
|
nb_sessions_attached=$(tmux list-session | grep "attached" | wc -l)
|
||||||
|
nb_sessions_detached=$(tmux list-session | grep -v "attached" | wc -l)
|
||||||
|
|
||||||
|
echo_reverse "Found ${nb_sessions} tmux session(s)"
|
||||||
|
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user