tmux add red bg if ssh connection

This commit is contained in:
masterzu 2025-06-25 00:00:02 +02:00
parent cb122db07e
commit e6764a482f
Signed by untrusted user who does not match committer: pcao
GPG Key ID: B57DBE40C72FBCF4
1 changed files with 9 additions and 3 deletions

View File

@ -39,10 +39,16 @@ set-option -g history-limit 10000
set -g status on
set -g status-keys vi
# check config file is readen
# set -g status-left "CONFIG OK"
# Si connecté en SSH, changer la bg en red, sino en gree
if-shell 'env | grep -q SSH_CONNECTION' \
'set -g @bg red' \
'set -g @bg green'
set -g status-style "bg=#{@bg} fg=black italics"
# change color
set -g status-style 'bg=green fg=black italics'
# time et hostname
set -g status-right "#[fg=blue bg=black noitalics bold] %R #[fg=yellow nobold]#{user}#[fg=white bg=black noitalics bold]@#h #[bg=green fg=black ] "
set -g status-right "#[fg=blue bg=black noitalics bold] %R #[fg=yellow nobold italics]#{user}#[fg=white noitalics]@#[fg=#{@bg} bg=black noitalics bold]#h #[bg=#{@bg} fg=black ] "
# reload this file
bind r source-file /home/patrick/.tmux.conf \; display-message ".tmux.conf reloaded"