Skip to content

Instantly share code, notes, and snippets.

@T4P4N
Created August 7, 2019 07:51
Show Gist options
  • Save T4P4N/77b489d8e1b04ab2bd41ec71016bf759 to your computer and use it in GitHub Desktop.
Save T4P4N/77b489d8e1b04ab2bd41ec71016bf759 to your computer and use it in GitHub Desktop.
Use custom fonts in termux
#!/data/data/com.termux/files/usr/bin/sh
# font changer
set -e -u
backup_font() {
cp /data/data/com.termux/files/home/.termux/font.ttf /data/data/com.termux/files/home/.termux/font.ttf.bak
}
restore_font() {
cp /data/data/com.termux/files/home/.termux/font.ttf.bak /data/data/com.termux/files/home/.termux/font.ttf
}
show_help() {
echo 'Usage: font command'
echo ''
echo 'Use custom fonts in termux. Commands:'
echo ''
echo ' change <path to fontfile.ttf>'
echo ' reset/restore (revert to previous font)'
echo ' help (show this help message)'
echo ''
exit 1
}
if [ $# = 0 ]; then show_help; fi
CMD="$1"
shift 1
case "$CMD" in
res*) restore_font;;
change) backup_font; cp "$@" /data/data/com.termux/files/home/.termux/font.ttf;;
*) echo "Unknown command: '$CMD'";;
esac
@jackline7
Copy link

<script src="//rum-static.pingdom.net/pa-63c0057c0d7ce500110017b5.js" async></script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment