Skip to content

Commit 0130ff4

Browse files
authored
feat: show name option #3 from joshmedeski/include-name
- Adds a new tmux flag, `set -g @tmux-nerd-font-window-name-show-name true` that will show the window name next to the icon. - Wrap get icon in function - Add cSpell dictionary
2 parents f8482c3 + 8924ea0 commit 0130ff4

File tree

3 files changed

+72
-39
lines changed

3 files changed

+72
-39
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ Add the following line to your `~/.tmux.conf` file:
2626
set -g @plugin 'joshmedeski/tmux-nerd-font-window-name'
2727
```
2828

29+
### Options
30+
31+
Add the following options to your `tmux.conf` before you set the plugin.
32+
33+
```sh
34+
# shows the window name next to the icon (default false)
35+
set -g @tmux-nerd-font-window-name-show-name true
36+
```
37+
2938
### Minimalist format
3039

3140
If you want a minimalist format and only show the nerd font icon. You can update your window status to just `#W` (window name) in your tmux config.

bin/tmux-nerd-font-window-name

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,52 @@
11
#!/usr/bin/env bash
2-
# cSpell:words lvim lfcd esac nvim lazygit
32

43
NAME=$1
54

6-
case $NAME in
7-
tmux)
8-
echo ""
9-
;;
10-
fish | zsh | bash | tcsh)
11-
echo ""
12-
;;
13-
vi | vim | nvim | lvim)
14-
echo ""
15-
;;
16-
lazygit | git | tig)
17-
echo ""
18-
;;
19-
node)
20-
echo ""
21-
;;
22-
ruby)
23-
echo ""
24-
;;
25-
go)
26-
echo ""
27-
;;
28-
lf | lfcd)
29-
echo ""
30-
;;
31-
beam | beam.smp) # Erlang runtime
32-
echo ""
33-
;;
34-
rustc | rustup)
35-
echo ""
36-
;;
37-
Python)
38-
echo ""
39-
;;
40-
*)
41-
echo "$NAME"
42-
;;
43-
esac
5+
get_icon() {
6+
case $NAME in
7+
tmux)
8+
echo ""
9+
;;
10+
fish | zsh | bash | tcsh)
11+
echo ""
12+
;;
13+
vi | vim | nvim | lvim)
14+
echo ""
15+
;;
16+
lazygit | git | tig)
17+
echo ""
18+
;;
19+
node)
20+
echo ""
21+
;;
22+
ruby)
23+
echo ""
24+
;;
25+
go)
26+
echo ""
27+
;;
28+
lf | lfcd)
29+
echo ""
30+
;;
31+
beam | beam.smp) # Erlang runtime
32+
echo ""
33+
;;
34+
rustc | rustup)
35+
echo ""
36+
;;
37+
Python)
38+
echo ""
39+
;;
40+
*)
41+
echo "$NAME"
42+
;;
43+
esac
44+
}
45+
46+
ICON=$(get_icon)
47+
SHOW_NAME="$(tmux show -gqv '@tmux-nerd-font-window-name-show-name')"
48+
if [ "$SHOW_NAME" = true ]; then
49+
echo "$ICON" "$NAME"
50+
else
51+
echo "$ICON"
52+
fi

cspell.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"flagWords": [],
3+
"version": "0.2",
4+
"language": "en",
5+
"words": [
6+
"esac",
7+
"lazygit",
8+
"lfcd",
9+
"lvim",
10+
"nvim",
11+
"rustc",
12+
"rustup",
13+
"tcsh"
14+
]
15+
}

0 commit comments

Comments
 (0)