Created
September 16, 2014 11:02
-
-
Save auselen/97e46ef6337ae846f4b6 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/sh | |
#create rings | |
echo creating hours ring | |
for i in $( seq 6 6 360 ); do convert -size 220x176 -depth 16 xc:transparent -fill none -stroke DarkOrange3 -draw "stroke-width 16 ellipse 110,88 74,74 270,$((270 + i))" polar_hours_$i.png; done | |
echo creating minutes ring | |
for i in $( seq 6 6 360 ); do convert -size 220x176 -depth 16 xc:transparent -fill none -stroke DarkOrange4 -draw "stroke-width 16 ellipse 110,88 58,58 270,$((270 + i))" polar_minutes_$i.png; done | |
echo creating seconds ring | |
for i in $( seq 6 6 360 ); do convert -size 220x176 -depth 16 xc:transparent -fill none -stroke peru -draw "stroke-width 16 ellipse 110,88 42,42 270,$((270 + i))" polar_seconds_$i.png; done | |
# create preview image | |
echo creating preview image | |
composite polar_hours_96.png polar_minutes_264.png polar_preview.png | |
composite polar_seconds_174.png polar_preview.png polar_preview.png | |
echo creating empty image | |
convert -size 210x170 xc:transparent polar_empty.png | |
# create levellists | |
for t in "hours" "minutes" "seconds" | |
do | |
filename="clock_widget_polar_$t.xml" | |
echo creating $filename | |
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" > $filename | |
echo "<level-list xmlns:android=\"http://schemas.android.com/apk/res/android\" >" >> $filename | |
# use same empty class | |
echo "<item android:drawable=\"@drawable/polar_empty\"/>" >> $filename | |
for i in $( seq 6 6 360 ); do echo "<item android:drawable=\"@drawable/polar_${t}_${i}\"/>" >> $filename; done | |
echo "</level-list>" >> $filename | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment