Fix last commit to annna PATH standards and naming. - annna - Annna the nice fr… | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit cde2c5e56c12b8a58bd63a772f1cfeaef8e556c4 | |
parent 4d6d4eaa7f3062b998498a2f9ee90e830805a42f | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Tue, 11 Jan 2022 21:11:54 +0100 | |
Fix last commit to annna PATH standards and naming. | |
Diffstat: | |
M annna-message-common | 2 +- | |
R imgsearch.sh -> image-search | 0 | |
A simulate-simulator | 28 ++++++++++++++++++++++++++++ | |
D simulate.sh | 26 -------------------------- | |
4 files changed, 29 insertions(+), 27 deletions(-) | |
--- | |
diff --git a/annna-message-common b/annna-message-common | |
@@ -861,7 +861,7 @@ case "${text}" in | |
q="${q% simulator*}" | |
outpath="/br/gopher/p/" | |
{ | |
- if outfile="$(./simulate.sh "$q")" | |
+ if outfile="$(simulate-simulator "$q")" | |
then | |
mv "${outfile}" "${outpath}/" | |
annna-say -s "${server}" -c "${channel}" "${user}, gop… | |
diff --git a/imgsearch.sh b/image-search | |
diff --git a/simulate-simulator b/simulate-simulator | |
@@ -0,0 +1,28 @@ | |
+#!/bin/sh | |
+ | |
+export PATH="$HOME/bin:$PATH" | |
+ | |
+die() { | |
+ printf '%s: error: %s\n' "${0%%*/}" "$1" | |
+ exit "${2:-1}" | |
+} | |
+ | |
+for q in "$@" | |
+do | |
+ year="$(( RANDOM / 1000 + 1990 ))" | |
+ if ! img="$(image-search "$q")" | |
+ then | |
+ die "could not find a image for '$q'" | |
+ fi | |
+ out="${img%.*}-simulator.jpg" | |
+ convert -gravity NorthWest \ | |
+ -font "Helvetica-Narrow-Oblique" -pointsize 70 \ | |
+ -stroke '#000C' -strokewidth 2 -annotate +0+10 "$q" \ | |
+ -stroke none -fill white -annotate +0+10 "$q" \ | |
+ -stroke '#000C' -strokewidth 2 -annotate +0+80 "Simulator" \ | |
+ -stroke none -fill white -annotate +0+80 "Simulator" \ | |
+ -stroke '#000C' -strokewidth 2 -annotate +0+150 "$year" \ | |
+ -stroke none -fill white -annotate +0+150 "$year" \ | |
+ "$img" "$out" | |
+ printf '%s\n' "$out" | |
+done | |
diff --git a/simulate.sh b/simulate.sh | |
@@ -1,26 +0,0 @@ | |
-#!/bin/sh | |
- | |
-die() { | |
- printf '%s: error: %s\n' "${0%%*/}" "$1" | |
- exit "${2:-1}" | |
-} | |
- | |
-for q in "$@" | |
-do | |
- year="$(( RANDOM / 1000 + 1990 ))" | |
- if ! img="$(./imgsearch.sh "$q")" | |
- then | |
- die "could not find a image for '$q'" | |
- fi | |
- out="${img%.*}-simulator.jpg" | |
- convert -gravity NorthWest \ | |
- -font "Helvetica-Narrow-Oblique" -pointsize 70 \ | |
- -stroke '#000C' -strokewidth 2 -annotate +0+10 "$q" \ | |
- -stroke none -fill white -annotate +0+10 "$q" \ | |
- -stroke '#000C' -strokewidth 2 -annotate +0+80 "Simulator" \ | |
- -stroke none -fill white -annotate +0+80 "Simulator" \ | |
- -stroke '#000C' -strokewidth 2 -annotate +0+150 "$year" \ | |
- -stroke none -fill white -annotate +0+150 "$year" \ | |
- "$img" "$out" | |
- printf '%s\n' "$out" | |
-done |