From f54cede3680d935817da5356f5e1582c819e37ac Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Wed, 18 Sep 2019 23:17:04 +0200 Subject: [PATCH] pass $tmux_conf_theme_root to the _root() helper instead of using a tmux variable --- .tmux.conf | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index e2e3cb5..38cdf13 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -587,13 +587,11 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim # # _root() { # tty=${1:-$(tmux display -p '#{pane_tty}')} +# root=$2 +# # username=$(_username "$tty" false) # -# if [ x"$username" = x"root" ]; then -# tmux show -gqv '@root' -# else -# echo "" -# fi +# [ x"$username" = x"root" ] && echo "$root" # } # # _uptime() { @@ -938,7 +936,7 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim # -e "s/#{prefix}/#[fg=$tmux_conf_theme_prefix_fg]#[bg=$tmux_conf_theme_prefix_bg]#[$tmux_conf_theme_prefix_attr]#{?client_prefix,$tmux_conf_theme_prefix,}/g") # # tmux_conf_theme_status_left=$(echo "$tmux_conf_theme_status_left" | sed \ -# -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#(cut -c3- ~/.tmux.conf | sh -s _root #{pane_tty} #D)#[inherit]%g") +# -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#(cut -c3- ~/.tmux.conf | sh -s _root #{pane_tty} $tmux_conf_theme_root #D)#[inherit]%g") # # tmux_conf_theme_status_left=$(echo "$tmux_conf_theme_status_left" | sed \ # -e "s%#{synchronized}%#[fg=$tmux_conf_theme_synchronized_fg]#[bg=$tmux_conf_theme_synchronized_bg]#[$tmux_conf_theme_synchronized_attr]#{?pane_synchronized,$tmux_conf_theme_synchronized,}%g") @@ -1026,7 +1024,7 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim # -e "s/#{prefix}/#[fg=$tmux_conf_theme_prefix_fg]#[bg=$tmux_conf_theme_prefix_bg]#[$tmux_conf_theme_prefix_attr]#{?client_prefix,$tmux_conf_theme_prefix,}/g") # # tmux_conf_theme_status_right=$(echo "$tmux_conf_theme_status_right" | sed \ -# -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#(cut -c3- ~/.tmux.conf | sh -s _root #{pane_tty} #D)#[inherit]%g") +# -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#(cut -c3- ~/.tmux.conf | sh -s _root #{pane_tty} $tmux_conf_theme_root #D)#[inherit]%g") # # tmux_conf_theme_status_right=$(echo "$tmux_conf_theme_status_right" | sed \ # -e "s%#{synchronized}%#[fg=$tmux_conf_theme_synchronized_fg]#[bg=$tmux_conf_theme_synchronized_bg]#[$tmux_conf_theme_synchronized_attr]#{?pane_synchronized,$tmux_conf_theme_synchronized,}%g") @@ -1093,8 +1091,6 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim # # # -- variables # -# tmux set -g '@root' "$tmux_conf_theme_root" -# # tmux_conf_battery_bar_symbol_full=${tmux_conf_battery_bar_symbol_full:-◼} # tmux_conf_battery_bar_symbol_empty=${tmux_conf_battery_bar_symbol_empty:-◻} # tmux_conf_battery_bar_length=${tmux_conf_battery_bar_length:-auto}