mirror of
https://github.com/tmux-plugins/tmux-continuum.git
synced 2025-09-09 06:08:52 +00:00
Continuum status
This commit is contained in:
25
scripts/continuum_status.sh
Executable file
25
scripts/continuum_status.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
source "$CURRENT_DIR/helpers.sh"
|
||||
source "$CURRENT_DIR/variables.sh"
|
||||
|
||||
print_status() {
|
||||
local save_int="$(get_tmux_option "$auto_save_interval_option")"
|
||||
local status=""
|
||||
local style_wrap
|
||||
if [ $save_int -gt 0 ]; then
|
||||
style_wrap="$(get_tmux_option "$status_on_style_wrap_option" "")"
|
||||
status="$save_int"
|
||||
else
|
||||
style_wrap="$(get_tmux_option "$status_off_style_wrap_option" "")"
|
||||
status="off"
|
||||
fi
|
||||
|
||||
if [ -n "$style_wrap" ]; then
|
||||
status="${style_wrap/$status_wrap_string/$status}"
|
||||
fi
|
||||
echo "$status"
|
||||
}
|
||||
print_status
|
@ -25,3 +25,10 @@ auto_start_config_default=""
|
||||
|
||||
osx_auto_start_file_name="Tmux.Start.plist"
|
||||
osx_auto_start_file_path="${HOME}/Library/LaunchAgents/${osx_auto_start_file_name}"
|
||||
|
||||
status_interpolation_string="\#{continuum_status}"
|
||||
status_script="#($CURRENT_DIR/scripts/continuum_status.sh)"
|
||||
# below options set style/color for #{continuum_status} interpolation
|
||||
status_on_style_wrap_option="@continuum-status-on-wrap-style" # example value: "#[fg=green]#{value}#[fg=white]"
|
||||
status_off_style_wrap_option="@continuum-status-off-wrap-style" # example value: "#[fg=yellow,bold]#{value}#[fg=white,nobold]"
|
||||
status_wrap_string="\#{value}"
|
||||
|
Reference in New Issue
Block a user