simulate-simulator - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
simulate-simulator (822B) | |
--- | |
1 #!/bin/sh | |
2 | |
3 export PATH="$HOME/bin:$PATH" | |
4 | |
5 die() { | |
6 printf '%s: error: %s\n' "${0%%*/}" "$1" | |
7 exit "${2:-1}" | |
8 } | |
9 | |
10 for q in "$@" | |
11 do | |
12 year="$(( RANDOM / 1000 + 1990 ))" | |
13 if ! img="$(image-search "$q")" | |
14 then | |
15 die "could not find a image for '$q'" | |
16 fi | |
17 if [ -z "${img}" ]; | |
18 then | |
19 die "could not find a image for '$q'" | |
20 fi | |
21 | |
22 out="${img%.*}-simulator.jpg" | |
23 magick convert -gravity NorthWest \ | |
24 -font "Helvetica-Narrow-Oblique" -pointsize 70 \ | |
25 -stroke '#000C' -strokewidth 2 -annotate +0+10 "$q" \ | |
26 -stroke none -fill white -annotate +0+10 "$q" \ | |
27 -stroke '#000C' -strokewidth 2 -annotate +0+80 "Simulato… | |
28 -stroke none -fill white -annotate +0+80 "Simulator" \ | |
29 -stroke '#000C' -strokewidth 2 -annotate +0+150 "$year" \ | |
30 -stroke none -fill white -annotate +0+150 "$year" \ | |
31 "$img" "$out" | |
32 printf '%s\n' "$out" | |
33 done |