Skip to content

Instantly share code, notes, and snippets.

@openback
Created July 26, 2009 03:34
Show Gist options
  • Save openback/155419 to your computer and use it in GitHub Desktop.
Save openback/155419 to your computer and use it in GitHub Desktop.
A shell script that uses adb to push fonts onto the G1. Make sure adb is in your path.
#!/bin/bash
# make sure we have 1 or 2 arguments
if [ $# -ne 1 ] && [ $# -ne 2 ]; then
echo "usage: `basename $0` font [bold_font]"
exit 1
fi
adb devices|grep -w device > /dev/null
if [ $? -eq 1 ]; then
echo "Error: device not found by adb"
exit 1
fi
echo "Device found"
echo "- Remounting / as rw"
adb remount
echo "- Sending fonts"
adb push "$1" /system/fonts/DroidSans.ttf
if [ $# -eq 2 ]; then
adb push "$2" /system/fonts/DroidSans-Bold.ttf
else
adb push "$1" /system/fonts/DroidSans-Bold.ttf
fi
echo "- Remounting / as ro"
adb remount
echo "Done."
echo -n "Reboot device (Y/N)? "
read reply
if [ "$reply" == "y" ] || [ "$reply" == "Y" ]; then
echo "Rebooting device..."
adb shell reboot
fi
@openback
Copy link
Author

Instead of this, now you can use Type Fresh!

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