-
Notifications
You must be signed in to change notification settings - Fork 335
NerdFonts installer script added and consequential change to tab_data TOML file. #446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
022cb04
1bcdb20
87ef718
e1a52d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,141 @@ | ||||||||||||||||||||||||||
#!/bin/sh -e | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Import common utilities | ||||||||||||||||||||||||||
. ../common-script.sh | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# List of available fonts | ||||||||||||||||||||||||||
fonts=" | ||||||||||||||||||||||||||
0xProto_Nerd_Font | ||||||||||||||||||||||||||
3270_Nerd_Font | ||||||||||||||||||||||||||
Agave_Nerd_Font | ||||||||||||||||||||||||||
AnonymicePro_Nerd_Font | ||||||||||||||||||||||||||
Arimo_Nerd_Font | ||||||||||||||||||||||||||
AurulentSansMono_Nerd_Font | ||||||||||||||||||||||||||
BigBlueTerminal_Nerd_Font | ||||||||||||||||||||||||||
BitstromWera_Nerd_Font | ||||||||||||||||||||||||||
BlexMono_Nerd_Font | ||||||||||||||||||||||||||
CaskaydiaCove_Nerd_Font | ||||||||||||||||||||||||||
CaskaydiaMono_Nerd_Font | ||||||||||||||||||||||||||
CodeNewRoman_Nerd_Font | ||||||||||||||||||||||||||
ComicShannsMono_Nerd_Font | ||||||||||||||||||||||||||
CommitMono_Nerd_Font | ||||||||||||||||||||||||||
Cousine_Nerd_Font | ||||||||||||||||||||||||||
D2Coding_Nerd_Font | ||||||||||||||||||||||||||
DaddyTimeMono_Nerd_Font | ||||||||||||||||||||||||||
DejaVuSansMono_Nerd_Font | ||||||||||||||||||||||||||
DroidSansMono_Nerd_Font | ||||||||||||||||||||||||||
EnvyCodeR_Nerd_Font | ||||||||||||||||||||||||||
FantasqueSansMono_Nerd_Font | ||||||||||||||||||||||||||
FiraCode_Nerd_Font | ||||||||||||||||||||||||||
FiraMono_Nerd_Font | ||||||||||||||||||||||||||
GeistMono_Nerd_Font | ||||||||||||||||||||||||||
GoMono_Nerd_Font | ||||||||||||||||||||||||||
Gohu_Nerd_Font | ||||||||||||||||||||||||||
Hack_Nerd_Font | ||||||||||||||||||||||||||
Hasklug_Nerd_Font | ||||||||||||||||||||||||||
HeavyDataMono_Nerd_Font | ||||||||||||||||||||||||||
Hurmit_Nerd_Font | ||||||||||||||||||||||||||
iM-Writing_Nerd_Font | ||||||||||||||||||||||||||
Inconsolata_Nerd_Font | ||||||||||||||||||||||||||
InconsolataGo_Nerd_Font | ||||||||||||||||||||||||||
Inconsolata_LGC_Nerd_Font | ||||||||||||||||||||||||||
IntoneMono_Nerd_Font | ||||||||||||||||||||||||||
Iosevka_Nerd_Font | ||||||||||||||||||||||||||
IosevkaTerm_Nerd_Font | ||||||||||||||||||||||||||
IosevkaTermSlab_Nerd_Font | ||||||||||||||||||||||||||
JetBrainsMono_Nerd_Font | ||||||||||||||||||||||||||
Lekton_Nerd_Font | ||||||||||||||||||||||||||
Literation_Nerd_Font | ||||||||||||||||||||||||||
Lilex_Nerd_Font | ||||||||||||||||||||||||||
MartianMono_Nerd_Font | ||||||||||||||||||||||||||
Meslo_Nerd_Font | ||||||||||||||||||||||||||
Monaspice_Nerd_Font | ||||||||||||||||||||||||||
Monofur_Nerd_Font | ||||||||||||||||||||||||||
Monoid_Nerd_Font | ||||||||||||||||||||||||||
Mononoki_Nerd_Font | ||||||||||||||||||||||||||
M+_Nerd_Font | ||||||||||||||||||||||||||
Noto_Nerd_Font | ||||||||||||||||||||||||||
OpenDyslexic_Nerd_Font | ||||||||||||||||||||||||||
Overpass_Nerd_Font | ||||||||||||||||||||||||||
ProFont_Nerd_Font | ||||||||||||||||||||||||||
ProggyClean_Nerd_Font | ||||||||||||||||||||||||||
RecMono_Nerd_Font | ||||||||||||||||||||||||||
RobotoMono_Nerd_Font | ||||||||||||||||||||||||||
SauceCodePro_Nerd_Font | ||||||||||||||||||||||||||
ShureTechMono_Nerd_Font | ||||||||||||||||||||||||||
SpaceMono_Nerd_Font | ||||||||||||||||||||||||||
Terminess_Nerd_Font | ||||||||||||||||||||||||||
Tinos_Nerd_Font | ||||||||||||||||||||||||||
Ubuntu_Nerd_Font | ||||||||||||||||||||||||||
UbuntuMono_Nerd_Font | ||||||||||||||||||||||||||
VictorMono_Nerd_Font | ||||||||||||||||||||||||||
ZedMono_Nerd_Font | ||||||||||||||||||||||||||
" | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Function to prompt user for font selection | ||||||||||||||||||||||||||
prompt_font_selection() { | ||||||||||||||||||||||||||
echo "Select fonts to install (separate with spaces):" | ||||||||||||||||||||||||||
echo "---------------------------------------------" | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Set number of columns | ||||||||||||||||||||||||||
cols=3 | ||||||||||||||||||||||||||
i=0 | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Calculate the format string dynamically | ||||||||||||||||||||||||||
for font in $fonts; do | ||||||||||||||||||||||||||
# Print font in columns | ||||||||||||||||||||||||||
printf "%-35s" "$i - $font" | ||||||||||||||||||||||||||
i=$((i + 1)) | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Print newline after every $cols fonts | ||||||||||||||||||||||||||
if [ $((i % cols)) -eq 0 ]; then | ||||||||||||||||||||||||||
echo "" | ||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||
done | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Print remaining fonts if the total count isn't a multiple of $cols | ||||||||||||||||||||||||||
if [ $((i % cols)) -ne 0 ]; then | ||||||||||||||||||||||||||
echo "" | ||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
echo "---------------------------------------------" | ||||||||||||||||||||||||||
printf "Enter the numbers of the fonts to install (e.g., '0 1 2'): " | ||||||||||||||||||||||||||
read font_selection | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
echo "Fonts selected: $font_selection" | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Function to download and install the selected fonts | ||||||||||||||||||||||||||
download_and_install_fonts() { | ||||||||||||||||||||||||||
i=0 | ||||||||||||||||||||||||||
for font in $fonts; do | ||||||||||||||||||||||||||
for selection in $font_selection; do | ||||||||||||||||||||||||||
if [ "$i" = "$selection" ]; then | ||||||||||||||||||||||||||
font_name=$(echo "$font" | sed 's/_/ /g') # Replace underscores with spaces | ||||||||||||||||||||||||||
echo "Downloading and installing $font_name..." | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Check if wget and tar are installed, using common-script.sh helper | ||||||||||||||||||||||||||
checkCommandRequirements "curl" | ||||||||||||||||||||||||||
checkCommandRequirements "tar" | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Download the font | ||||||||||||||||||||||||||
curl -sSLo "$HOME/tmp/$font_name.tar.xz" "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/$font_name.tar.xz" | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Extract and install the font | ||||||||||||||||||||||||||
mkdir -p ~/.local/share/fonts | ||||||||||||||||||||||||||
tar -xf "$HOME/tmp/$font_name.tar.xz" -C "$HOME/.local/share/fonts" | ||||||||||||||||||||||||||
rm "$HOME/tmp/$font_name.tar.xz" | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @adamperkowski There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||
done | ||||||||||||||||||||||||||
i=$((i + 1)) | ||||||||||||||||||||||||||
done | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Update the font cache | ||||||||||||||||||||||||||
fc-cache -vf | ||||||||||||||||||||||||||
echo "Fonts installed and cache updated." | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Main script execution | ||||||||||||||||||||||||||
checkEnv | ||||||||||||||||||||||||||
prompt_font_selection | ||||||||||||||||||||||||||
download_and_install_fonts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curl: (3) URL rejected: Malformed input to a URL function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tar
andcurl
are preloaded so what's the issue here.I could not reproduce your error:
curl: (3) URL rejected: Malformed input to a URL function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you did not test it, "TMP" a folder inside of the root file system does not exist inside of the users home directory