LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   script for display a clock from dated images (https://www.linuxquestions.org/questions/programming-9/script-for-display-a-clock-from-dated-images-403297/)

osio 01-14-2006 10:38 AM

script for display a clock from dated images
 
I wrote a tiny script to create image files with the date command

Quote:

$ sh now2jpg &

$ display -update 4 /tmp/jpg
Quote:

#!/bin/bash

# now2jpg
# 14/01/2006

# display -update detects changes in an image every number of seconds
echo "Usage in the background:" `basename $0` "& and display -update 4 /tmp/now.jpg"

while [ 1 ]
do
now=`/bin/date '+%Y%m%d%H%M%S'`
convert -size 110x25 xc:white /tmp/base.png
# the variable $now can be rendered as an image with the -draw option
convert -draw "text 10,15 '$now'" /tmp/base.png /tmp/now.jpg
sleep 2
done
How can I insert the shell command 'display -update 4 /tmp/now.jpg' in the loop so the scripts doesn't need two prompt entries?


All times are GMT -5. The time now is 03:46 PM.