Created
August 7, 2019 07:51
-
-
Save T4P4N/77b489d8e1b04ab2bd41ec71016bf759 to your computer and use it in GitHub Desktop.
Use custom fonts in termux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
commented
Jan 12, 2023
<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