Автоматическое перемещение статус-бара в зависимости от типа подключения

This commit is contained in:
EoF
2019-09-19 18:57:29 +05:00
parent 4f3d96846f
commit e5e30d079a
5 changed files with 24 additions and 27 deletions

View File

@@ -1,7 +0,0 @@
#!/usr/bin/env bash
if [ -n "$SSH_CONNECTION" ]; then
tmux set status-position bottom
else
tmux set -u status-position
fi

20
tmux/utils/status-switch.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Determine current session type - remote or local
if [ -n "$SSH_CONNECTION" ]; then
# Show status bar at bottom for remote session,
# so it do not stack together with local session's one
tmux set status-position bottom
# In remote mode we don't show "clock" and "battery status" widgets
set status-left "$wg_session"
set status-right "#{prefix_highlight} $wg_is_keys_off $wg_is_zoomed #{sysstat_cpu} | #{sysstat_mem} | #{sysstat_loadavg} | $wg_user_host | #{online_status}"
# Set port of SSH remote tunnel, where tmux will pipe buffers to transfer on local machine for copy
# set -g @copy_backend_remote_tunnel_port 11988
else
# Just unset session-variables for local session
tmux set -u status-position
tmux set -u status-left
tmux set -u status-right
fi