-
-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathinstall-tmux-fonts.sh
More file actions
152 lines (135 loc) Β· 4.24 KB
/
install-tmux-fonts.sh
File metadata and controls
152 lines (135 loc) Β· 4.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/bin/bash
# Quick Font Installation Script for Tmux
# Installs powerline fonts for better tmux appearance
echo "π¨ Tmux Font Installer"
echo "====================="
echo ""
# Check if running in WSL or native Linux
if grep -qi microsoft /proc/version; then
echo "βΉοΈ Detected WSL environment"
echo "β οΈ Note: You'll also need to configure your Windows Terminal font"
echo ""
fi
# Function to install powerline fonts
install_powerline() {
echo "π¦ Installing Powerline Fonts..."
if command -v apt-get &> /dev/null; then
# Debian/Ubuntu
sudo apt-get update
sudo apt-get install -y fonts-powerline
echo "β
Powerline fonts installed via apt"
elif command -v pacman &> /dev/null; then
# Arch Linux
sudo pacman -S --noconfirm powerline-fonts
echo "β
Powerline fonts installed via pacman"
elif command -v dnf &> /dev/null; then
# Fedora
sudo dnf install -y powerline-fonts
echo "β
Powerline fonts installed via dnf"
else
# Install from source
echo "π₯ Installing from source..."
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh
cd ..
rm -rf fonts
echo "β
Powerline fonts installed from source"
fi
}
# Function to install nerd fonts
install_nerd_fonts() {
echo ""
echo "π¦ Installing Nerd Fonts (FiraCode)..."
# Create fonts directory
mkdir -p ~/.local/share/fonts
# Download FiraCode Nerd Font
cd ~/.local/share/fonts
if command -v wget &> /dev/null; then
wget -q --show-progress https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FiraCode.zip
elif command -v curl &> /dev/null; then
curl -L -o FiraCode.zip https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FiraCode.zip
else
echo "β Neither wget nor curl found. Please install one and try again."
return 1
fi
# Extract
if command -v unzip &> /dev/null; then
unzip -q FiraCode.zip
rm FiraCode.zip
echo "β
FiraCode Nerd Font installed"
else
echo "β unzip not found. Please install unzip and try again."
return 1
fi
cd - > /dev/null
}
# Function to refresh font cache
refresh_fonts() {
echo ""
echo "π Refreshing font cache..."
fc-cache -fv > /dev/null 2>&1
echo "β
Font cache refreshed"
}
# Function to test fonts
test_fonts() {
echo ""
echo "π§ͺ Testing font symbols..."
echo ""
echo "Powerline arrows: "
echo "Icons: β "
echo ""
echo "If you see boxes or question marks, the fonts aren't working."
echo "Make sure your terminal is configured to use a Nerd Font."
}
# Main installation
echo "Choose installation option:"
echo "1) Powerline Fonts Only (lightweight, ~5MB)"
echo "2) Nerd Fonts (FiraCode) (complete, ~50MB)"
echo "3) Both (recommended)"
echo ""
read -p "Enter choice [1-3]: " choice
case $choice in
1)
install_powerline
;;
2)
install_nerd_fonts
;;
3)
install_powerline
install_nerd_fonts
;;
*)
echo "β Invalid choice"
exit 1
;;
esac
refresh_fonts
test_fonts
echo ""
echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββ"
echo "β
Font installation complete!"
echo ""
echo "π Next steps:"
echo ""
echo "1. Configure your terminal to use 'FiraCode Nerd Font Mono'"
echo ""
echo " Windows Terminal (WSL):"
echo " - Open Settings (Ctrl+,)"
echo " - Select your WSL profile"
echo " - Appearance β Font face β FiraCode Nerd Font Mono"
echo ""
echo " Gnome Terminal:"
echo " - Preferences β Profile β Text β Custom font"
echo " - Select 'FiraCode Nerd Font Mono'"
echo ""
echo "2. Reload tmux configuration:"
echo " tmux source-file ~/.tmux.conf"
echo ""
echo "3. Or restart tmux:"
echo " php artisan tmux:stop --force"
echo " php artisan tmux:start"
echo ""
echo "π Full guide: TMUX_FONTS_GUIDE.md"
echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββ"