From 105fb54755b0183fc160b76167e86e5c4f35a8d3 Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Fri, 20 Jul 2018 12:01:35 -0400 Subject: [PATCH] Added syncing indicator to tmux status line This checks for if the panes are synced or not, and provides and indicator resembling it in the status bar. --- .tmux.conf | 11 +++++++++++ .tmux.conf.local | 9 ++++++++- README.md | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index 045cf0f..62a92da 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -828,6 +828,11 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # tmux_conf_theme_root_bg=${tmux_conf_theme_root_bg:-'none'} # tmux_conf_theme_root_attr=${tmux_conf_theme_root_attr:-'bold,blink'} # +# tmux_conf_theme_synchronized=${tmux_conf_theme_synchronized:-'🔒'} # U+1F512 +# tmux_conf_theme_synchronized_fg=${tmux_conf_theme_synchronized_fg:-'none'} +# tmux_conf_theme_synchronized_bg=${tmux_conf_theme_synchronized_bg:-'none'} +# tmux_conf_theme_synchronized_attr=${tmux_conf_theme_synchronized_attr:-'none'} +# # # -- status left style # # tmux_conf_theme_status_left=${tmux_conf_theme_status_left-' ❐ #S '} @@ -844,6 +849,9 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # 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") # +# 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") +# # if [ -n "$tmux_conf_theme_status_left" ]; then # status_left=$(awk \ # -v fg_="$tmux_conf_theme_status_left_fg" \ @@ -928,6 +936,9 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # 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") # +# 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") +# # if [ -n "$tmux_conf_theme_status_right" ]; then # status_right=$(awk \ # -v fg_="$tmux_conf_theme_status_right_fg" \ diff --git a/.tmux.conf.local b/.tmux.conf.local index ae45b07..cd16497 100644 --- a/.tmux.conf.local +++ b/.tmux.conf.local @@ -151,6 +151,7 @@ tmux_conf_theme_right_separator_sub='|' # - #{pairing} # - #{prefix} # - #{root} +# - #{synchronized} # - #{uptime_d} # - #{uptime_h} # - #{uptime_m} @@ -158,7 +159,7 @@ tmux_conf_theme_right_separator_sub='|' # - #{username} # - #{username_ssh} tmux_conf_theme_status_left=' ❐ #S | ↑#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} ' -tmux_conf_theme_status_right='#{prefix}#{pairing} #{?battery_status, #{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} ' +tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #{?battery_status, #{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} ' # status left style tmux_conf_theme_status_left_fg='#000000,#e4e4e4,#e4e4e4' # black, white , white @@ -188,6 +189,12 @@ tmux_conf_theme_root_fg='none' tmux_conf_theme_root_bg='none' tmux_conf_theme_root_attr='bold,blink' +# synchronized indicator +tmux_conf_theme_synchronized='🔒' # U+1F512 +tmux_conf_theme_synchronized_fg='none' +tmux_conf_theme_synchronized_bg='none' +tmux_conf_theme_synchronized_attr='none' + # battery bar symbols tmux_conf_battery_bar_symbol_full='◼' tmux_conf_battery_bar_symbol_empty='◻' diff --git a/README.md b/README.md index b5bfbcc..a82ea00 100644 --- a/README.md +++ b/README.md @@ -253,6 +253,7 @@ This configuration supports the following builtin variables: - `#{pairing}`: is session attached to more than one client? - `#{prefix}`: is prefix being depressed? - `#{root}`: is current user root? + - `#{synchronized}`: are the panes synchronized? - `#{uptime_d}`: uptime days - `#{uptime_h}`: uptime hours - `#{uptime_m}`: uptime minutes