tmux-plugins / tmux-logging

Easy logging and screen capturing for Tmux.
MIT License
1.05k stars 114 forks source link

Persistent message on status bar to indicate if logging or not. #54

Closed azizj1 closed 3 years ago

azizj1 commented 3 years ago

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?

andyacer commented 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}"
mosheDO commented 3 years ago

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

bruno- commented 3 years ago

Closing as @mosheDO provided response.