Skip to content

Commit

Permalink
feat(termux): change default font
Browse files Browse the repository at this point in the history
  • Loading branch information
massix committed Mar 20, 2024
1 parent c2b57cf commit 477305d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

*** Termux
This simple module will create a sane ~termux.properties~ file and copy
over the [[https://www.nerdfonts.com/font-downloads][Agave]] patched font from NerdFonts.
over the [[https://www.nerdfonts.com/font-downloads][0xProto]] patched font from NerdFonts.

*** Git
Simple module that simply creates a ~.gitconfig~ file and stores it in
Expand Down
31 changes: 13 additions & 18 deletions termux/install_termux.fish
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,32 @@ source "$current_dir/../scripts/library.fish"

set termux_dir "$HOME/.termux"
set -l cache_dir "$HOME/.cache/installer"
mkdir -p $cache_dir
mkdir -p {$cache_dir}/font

set -l font_url "https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/0xProto.zip"

set -l font_url "https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/Agave.zip"
check_install curl curl

if test -f $termux_dir/termux.properties
backup_file "$termux_dir/termux.properties" "$backup_dir/termux-$(date +'%s').properties"
if test -f {$termux_dir}/termux.properties
backup_file "$termux_dir/termux.properties" "$backup_dir/termux-$(date +'%s').properties"
end

info "Copying termux properties"
cp $current_dir/termux.properties "$termux_dir/termux.properties"
cp {$current_dir}/termux.properties "$termux_dir/termux.properties"

if ! test -f "$cache_dir/font.zip"
info "Downloading font"
curl -sL "$font_url" -o "$cache_dir/font.zip"
end
info "Downloading font"
curl -sL "$font_url" -o "$cache_dir/font.zip"

info "Unpacking font"
unzip -qq -o -x "$cache_dir/font.zip" -d "$cache_dir"
unzip -qq -o -x "$cache_dir/font.zip" -d "$cache_dir/font/"

info "Copying patched font"
cp $cache_dir/*Mono-Regular.ttf $termux_dir/font.ttf
cp {$cache_dir}/font/0xProtoNerdFont-Regular.ttf {$termux_dir}/font.ttf

info "Cleaning cache folder"
rm -f $cache_dir/*.ttf
rm -f $cache_dir/*.md
rm -f $cache_dir/LICENSE*
rm -f $cache_dir/*.txt
rm -rf {$cache_dir}/font/*

if command -q termux-reload-settings
info "Reloading termux configuration"
termux-reload-settings
info "Reloading termux configuration"
termux-reload-settings
end

0 comments on commit 477305d

Please sign in to comment.