Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #!/data/data/com.termux/files/usr/bin/sh
  2. # font changer
  3. set -e -u
  4.  
  5. backup_font() {
  6. cp /data/data/com.termux/files/home/.termux/font.ttf /data/data/com.termux/files/home/.termux/font.ttf.bak
  7. }
  8.  
  9. restore_font() {
  10. cp /data/data/com.termux/files/home/.termux/font.ttf.bak /data/data/com.termux/files/home/.termux/font.ttf
  11. }
  12.  
  13. show_help() {
  14. echo 'Usage: font command'
  15. echo ''
  16. echo 'Use custom fonts in termux. Commands:'
  17. echo ''
  18. echo ' change <path to fontfile.ttf>'
  19. echo ' reset/restore (revert to previous font)'
  20. echo ' help (show this help message)'
  21. echo ''
  22. exit 1
  23. }
  24. if [ $# = 0 ]; then show_help; fi
  25. CMD="$1"
  26. shift 1
  27.  
  28. case "$CMD" in
  29. res*) restore_font;;
  30. change) backup_font; cp "$@" /data/data/com.termux/files/home/.termux/font.ttf;;
  31. *) echo "Unknown command: '$CMD'";;
  32. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement