parsing convert output in a loop war pretty dumb.. bounce not working yet

This commit is contained in:
Marcus 2024-01-04 02:48:58 +01:00
parent 7332285c93
commit fb10c06513

View file

@ -210,10 +210,7 @@ convertimg() {
fi
while read -r LINE
do
echo "PX $LINE"
done < <(convert $IMGFILE $RESIZE txt: | tail -n +2 | awk '{print $1 $3}' | sed -e 's/\,/ /' -e 's/\:/ /' -e 's/\#//')
convert $IMGFILE $RESIZE txt: | tail -n +2 | awk '{print $1 $3}' | sed -e 's/\,/ /' -e 's/\:/ /' -e 's/\#//' -e 's/^/PX /'
}
#~ generate_text() {
@ -237,6 +234,27 @@ shuf_xy() {
cursor) command -v xdotool || message error "${YELLOW}xdotool${ENDCOLOR} not found"
echo "OFFSET $(xdotool getmouselocation | tr ':' ' '|awk '{print $2 " " $4}')"
;;
bounce) test -z $X_MAX && X_MAX=800
test -z $Y_MAX && Y_MAX=600
if [ $sx -le $X_MAX ]
then
sx=$((sx+1))
else
sx=$((sx-1))
fi
if [ $sy -le $Y_MAX ]
then
sy=$((sy+1))
else
sy=$((sy-1))
fi
echo "OFFSET $sx $sy"
;;
static|*) test -z $H && H=0
test -z $W && W=0