first thoughts of ANIMATION function, comments clean up

This commit is contained in:
Marcus 2024-01-06 05:11:34 +01:00
parent 0d0eec495f
commit f5ec4fe401

View file

@ -32,7 +32,19 @@ YDIR=0
test -z "$BOUNCESTEP" && BOUNCESTEP=2 test -z "$BOUNCESTEP" && BOUNCESTEP=2
## end bounce ## end bounce
## ANIMATION
# convert -coalesce animation.gif target.png -> produces target1.png, target2.png, ..
# /dev/shm/foo to store frame counter
#
# GifFileFormat - gif, jpg, png || detect which fileformat IMGFILE is
test -z "$ANIMATION" && ANIMATION="false"
## END ANIMATION
## old crap
declare -a PIXMAP declare -a PIXMAP
## end old crap
declare -a LOL declare -a LOL
declare -a LOLPID declare -a LOLPID
@ -225,10 +237,6 @@ convertimg() {
convert $IMGFILE $BORDER $RESIZE txt: | tail -n +2 | awk '{print $1 $3}' | sed -e 's/\,/ /' -e 's/\:/ /' -e 's/\#//' -e 's/^/PX /' convert $IMGFILE $BORDER $RESIZE txt: | tail -n +2 | awk '{print $1 $3}' | sed -e 's/\,/ /' -e 's/\:/ /' -e 's/\#//' -e 's/^/PX /'
} }
#~ generate_text() {
#~ }
xymode() { xymode() {
case $SHUFMODE in case $SHUFMODE in
@ -276,18 +284,7 @@ xymode() {
OFFSET="OFFSET $X $Y" OFFSET="OFFSET $X $Y"
;; ;;
esac esac
#
#
#echo "OFFSET $(shuf -i 0-1760 -n 1) 919"
#echo > /dev/null
#~ echo "OFFSET $sx $sy"
#~ sx=$((sx+1))
#~ sy=$((sy+1))
#~ test $sx -gt 1760 && sx=0
#~ test $sy -gt 920 && sy=0
} }
flootworker() flootworker()
@ -344,10 +341,6 @@ loadLOL() {
i=$(($i+1)) i=$(($i+1))
done done
#~ echo "${LOL[14]}"
#~ echo STOP
#~ read
else else
for i in $(seq 1 $FLOOTFORKS) for i in $(seq 1 $FLOOTFORKS)
@ -427,11 +420,6 @@ floot() {
#convertimg > $PIXLIST #convertimg > $PIXLIST
fi fi
#LOL[$i]="OFFSET 1 200"
#LOL[$i]="OFFSET $(shuf -i 0-1760 -n 1) $(shuf -i 0-920 -n 1)"
# LOL[$i]="$(shuf_xy)"
#LOL[$i]="$(cat $PIXLIST | shuf)"
message "prepare worker ${YELLOW}$i${ENDCOLOR} .." message "prepare worker ${YELLOW}$i${ENDCOLOR} .."
#set -x #set -x
loadLOL loadLOL
@ -451,8 +439,6 @@ floot() {
if [ -z ${LOLPID[$i]} ] || ! ps -p ${LOLPID[$i]} > /dev/null if [ -z ${LOLPID[$i]} ] || ! ps -p ${LOLPID[$i]} > /dev/null
then then
message "worker ${YELLOW}$i${ENDCOLOR} is not running, starting it" message "worker ${YELLOW}$i${ENDCOLOR} is not running, starting it"
#if [ "$FLOOTSRUNNING" -le "$FLOOTFORKS" ]
#then
if [ $LARGE ] if [ $LARGE ]
then then
flootworker $LOLFIELDS & flootworker $LOLFIELDS &
@ -461,8 +447,6 @@ floot() {
flootworker $i & flootworker $i &
LOLPID[$i]=$! LOLPID[$i]=$!
fi fi
#fi
fi fi
done done
done done
@ -493,11 +477,8 @@ case $1 in
;; ;;
floot) message "flooting ${YELLOW}${IPFLOOT}:${FLOOTPORT}${ENDCOLOR}" floot) message "flooting ${YELLOW}${IPFLOOT}:${FLOOTPORT}${ENDCOLOR}"
#~ if [ "$SHUFMODE" == "static" ] && ([ -z "$X" ] && [ -z "$Y" ])
#~ then ##~ WIP - get the size of the board from server
#~ echo "please specify coords with e.g. 'W=420 H=420 SHUFMODE=static $0 floot $FNAME" >&2
#~ exit 1
#~ fi
#~ message "request board size from ${YELLOW}${IPFLOOT}:${FLOOTPORT}${ENDCOLOR}" #~ message "request board size from ${YELLOW}${IPFLOOT}:${FLOOTPORT}${ENDCOLOR}"
#~ exec 5<>/dev/tcp/$IPFLOOT/$FLOOTPORT #~ exec 5<>/dev/tcp/$IPFLOOT/$FLOOTPORT
#~ echo "SIZE" >&5 #~ echo "SIZE" >&5
@ -508,6 +489,8 @@ case $1 in
#~ exec 5<&- #~ exec 5<&-
#~ message "$BOARSIZE" #~ message "$BOARSIZE"
##~ END WIP
case $SHUFMODE in case $SHUFMODE in
cursor) cursor)
if ! command -v xdotool > /dev/null if ! command -v xdotool > /dev/null