From 2089e91547d3da892e1038967fd251ace030b953 Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Thu, 12 Sep 2024 22:40:05 -0300 Subject: [PATCH] Add a bash function to download and install Nerd Fonts --- bash/.bash/aliases.sh | 3 ++- bash/.bash/functions/fonts.sh | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 bash/.bash/functions/fonts.sh diff --git a/bash/.bash/aliases.sh b/bash/.bash/aliases.sh index 0c27107..7be6cf3 100644 --- a/bash/.bash/aliases.sh +++ b/bash/.bash/aliases.sh @@ -35,7 +35,8 @@ alias untar='tar -xvf' alias untargz='tar -xzvf' alias untarbz='tar -xjvf' alias lab='cd ~ && yavanna && tmux new-session -s lab -d jupyter-lab && cd $OLDPWD' -alias v='nvim' +alias nvim='~/bin/nvim.appimage' +alias v='~/bin/nvim.appimage' alias m='make' alias errcho='>&2 echo' diff --git a/bash/.bash/functions/fonts.sh b/bash/.bash/functions/fonts.sh new file mode 100644 index 0000000..77cd850 --- /dev/null +++ b/bash/.bash/functions/fonts.sh @@ -0,0 +1,16 @@ +# Dowload and install Nerd Fonts https://www.nerdfonts.com + +nerdfonts() { + if [[ $# -le 0 ]]; then + echo "Usage: nerdfonts FontName" + echo "" + echo "The name should be the package in the nerdfonts release page: https://github.com/ryanoasis/nerd-fonts/releases/latest" + else + wget -P ~/.local/share/fonts https://github.com/ryanoasis/nerd-fonts/releases/latest/download/$1.zip \ + && cd ~/.local/share/fonts \ + && unzip $1.zip \ + && rm $1.zip \ + && fc-cache -fv + cd - + fi +}