1
0
mirror of https://gitlab.com/ceda_ei/wish synced 2025-04-03 01:06:52 +02:00

Add tmux detached plugin

This commit is contained in:
Ceda EI 2019-02-16 17:16:20 +05:30
parent 749b2d8359
commit 4df41a68db

22
plugins/tmux.sh Normal file
View File

@ -0,0 +1,22 @@
function wish_tmux_start() {
return 0
}
function wish_tmux_end() {
return 0
}
function wish_tmux_set_colors() {
WISH_TMUX_FG=${WISH_TMUX_FG:-$WISH_DEFAULT_FG}
WISH_TMUX_BG=${WISH_TMUX_BG:-$WISH_DEFAULT_BG}
WISH_TMUX_SUFFIX=${WISH_TMUX_SUFFIX:-d}
}
function wish_tmux_main() {
local s=`tmux list-sessions 2>/dev/null | grep -vE "\(attached\)$" | wc -l`
if [[ $s -eq 0 ]]; then
wish_append $WISH_TMUX_BG $WISH_TMUX_FG $tmux
else
wish_append $WISH_TMUX_BG $WISH_TMUX_FG " $s$WISH_TMUX_SUFFIX "
fi
}