Closed azizj1 closed 3 years ago
RE: Logging ON/OFF indicator for status bar
I'm also interested in this. I'm a tmux novice, but this is what I've come up with so far. The below line correctly outputs the status when entered in a command prompt.
tmux show-option -gvq "$(tmux display-message -p @#{session_name}_#{window_index}_#{pane_index})"
I'm using the "Oh my tmux" setup, which allows for creating your own status functions. My attempt at that:
logging() {
local current_pane_logging=$(tmux show-option -gv "$(tmux display-message -p @#{session_name}_#{window_index}_#{pane_index})")
if [ "$current_pane_logging" == "logging" ]; then
printf 'ON ✔'
else
printf 'OFF x'
fi
}
Referencing this function with the following didn't seem to work. Not sure if I'm on the right track here.
tmux_conf_theme_status_right="#{logging}"
Hi @andyacer
I succeeded to make it work inspired by your code
# logging() {
# current_pane_logging=$(tmux show-option -gv "$(tmux display-message -p @#{session_name}_#{window_index}_#{pane_index})")
# if [ $current_pane_logging = "logging" ]
# then
# printf 'Logging ON ✔'
# else
# printf 'Logging OFF ✘'
# fi
# sleep 3 #sleep for 3 seconds
# }
Also does anyone know why there is no maintain to this repo? there are good PR here that really helps. How can we add that?
If u can find a logging Symbol it will help a lot cause my status bar is full
Regards, Moshe
Closing as @mosheDO provided response.
Hello, this feature is very handy and love it thus far. One thing I do often is turn on logging and then forget if I did indeed turn on logging for this pane. It would be helpful if there was an indicator on the status bar letting me know if it's currently logging or not.
Is there anyway to do that? If not, is there a workaround for this?