nordtheme / tmux

An arctic, north-bluish clean and elegant tmux color theme.
https://www.nordtheme.com/ports/tmux
MIT License
1.06k stars 141 forks source link

Suggestion - Add Current Path Location to Tmux Status Bar with Optional Toggle #92

Open edudebortoli opened 1 month ago

edudebortoli commented 1 month ago

I currently use the current_path in the status bar on tmux.

I believe it would be a nice and simple implementation to add this as an option to the project, similar to the existing status_content feature.

image

Here is my customization. It essentially replaces the #W variable with #{b:pane_current_path} to display the current path.

set -g window-status-format "#[fg=black,bg=brightblack,nobold,noitalics,nounderscore] #[fg=white,bg=brightblack]#I #[fg=white,bg=brightblack,nobold,noitalics,nounderscore] #[fg=white,bg=brightblack]#{b:pane_current_path} #F #[fg=brightblack,bg=black,nobold,noitalics,nounderscore]"
set -g window-status-current-format "#[fg=black,bg=cyan,nobold,noitalics,nounderscore] #[fg=black,bg=cyan]#I #[fg=black,bg=cyan,nobold,noitalics,nounderscore] #[fg=black,bg=cyan]#{b:pane_current_path} #F #[fg=cyan,bg=black,nobold,noitalics,nounderscore]"

and something like it to the nord.tmux file ( + variables in the beggining of the file )

  if [ "$status_content" != "0" ]; then
    if [ "$status_content" = "1" ]; then
      if [ "$no_patched_font" != "1" ]; then
        tmux source-file "$_current_dir/$NORD_TMUX_STATUS_CONTENT_FILE"
      else
        tmux source-file "$_current_dir/$NORD_TMUX_STATUS_CONTENT_NO_PATCHED_FONT_FILE"
      fi
    elif [ "$status_content" = "2" ]
      if [ "$no_patched_font" != "1" ]; then
        tmux source-file "$_current_dir/$NORD_TMUX_CURRENT_PATH_FILE"
      else
        tmux source-file "$_current_dir/$NORD_TMUX_CURRENT_PATH_NO_PATCHED_FONT_FILE"
      fi
    fi
  fi

status_content = 1: Uses the existing status content files. status_content = 2: Loads files that include the current path in the status bar.