Skip to content

Commit

Permalink
feat: add config to position the icon to the right or left of the win…
Browse files Browse the repository at this point in the history
…dow name (#30)
  • Loading branch information
joshmedeski authored Nov 25, 2023
1 parent 34599b7 commit 410d5be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ config:
fallback-icon: "?" # show when no definition is found
multi-pane-icon: "" # show when window has multiple panes (blank by default)
show-name: true # show the window name with the icon (defaults to false)
icon-position: "left" # show the icon to the "left" or "right" of the window name (defaults to left)

icons:
zsh: "" # overwrite with your own symbol (Nerd Font icon, emoji, whatever!)
Expand Down
7 changes: 6 additions & 1 deletion bin/tmux-nerd-font-window-name
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ fi

SHOW_NAME="$(get_config_value '.config.show-name')"
if [ "$SHOW_NAME" = true ]; then
ICON="$ICON $NAME"
ICON_POSITION="$(get_config_value '.config.icon-position')"
if [ "$ICON_POSITION" == "right" ]; then
ICON="$NAME $ICON"
else
ICON="$ICON $NAME"
fi
fi

echo "$ICON"

0 comments on commit 410d5be

Please sign in to comment.