modify tmux
This commit is contained in:
Executable
+86
@@ -0,0 +1,86 @@
|
||||
#!/bin/bash
|
||||
# tmux-window-name.sh - Auto emoji/icon plugin replacement for tmux window titles
|
||||
# Zero dependencies, fast shell-based script mapping commands to Nerd Font glyphs.
|
||||
|
||||
cmd="$1"
|
||||
path="$2"
|
||||
|
||||
# Get basename of the directory
|
||||
base_dir=$(basename "$path")
|
||||
if [ "$base_dir" = "$USER" ]; then
|
||||
base_dir="~"
|
||||
fi
|
||||
|
||||
icon=""
|
||||
name="$cmd"
|
||||
|
||||
case "$cmd" in
|
||||
zsh|bash|sh|fish|ksh)
|
||||
icon=""
|
||||
name="$base_dir"
|
||||
;;
|
||||
nvim|vim|vi)
|
||||
icon=""
|
||||
name="nvim ($base_dir)"
|
||||
;;
|
||||
emacs)
|
||||
icon=""
|
||||
name="emacs ($base_dir)"
|
||||
;;
|
||||
git|lazygit|gh)
|
||||
icon=""
|
||||
name="${cmd} ($base_dir)"
|
||||
;;
|
||||
node|npm|yarn|pnpm|bun)
|
||||
icon=""
|
||||
name="${cmd} ($base_dir)"
|
||||
;;
|
||||
python|python3|pip|ipython)
|
||||
icon=""
|
||||
;;
|
||||
docker|docker-compose|lazydocker)
|
||||
icon=""
|
||||
name="${cmd} ($base_dir)"
|
||||
;;
|
||||
cargo|rustc|rustup)
|
||||
icon=""
|
||||
name="${cmd} ($base_dir)"
|
||||
;;
|
||||
go)
|
||||
icon=""
|
||||
;;
|
||||
htop|top|btop)
|
||||
icon=""
|
||||
;;
|
||||
curl|wget)
|
||||
icon=""
|
||||
;;
|
||||
man)
|
||||
icon=""
|
||||
;;
|
||||
less|more)
|
||||
icon="📄"
|
||||
;;
|
||||
make|cmake|just)
|
||||
icon="🛠️"
|
||||
;;
|
||||
ssh|scp|sftp|mosh-client|mosh)
|
||||
icon="🔑"
|
||||
;;
|
||||
sudo)
|
||||
icon="🔒"
|
||||
;;
|
||||
terraform|tofu)
|
||||
icon=""
|
||||
name="${cmd} ($base_dir)"
|
||||
;;
|
||||
grep|rg|find|fd)
|
||||
icon="🔍"
|
||||
;;
|
||||
sleep)
|
||||
icon="💤"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Output the formatted name
|
||||
echo "$icon $name"
|
||||
Reference in New Issue
Block a user