The program is a Bash (sh) script that makes extensive use of awk to read and process GPS text strings. Update of most of the white text and the GPS quality indicators (mode, sats, pdop) are updated synchronously with the GPS data, that is, every second. The system indicators (memory, disk, load) are updated every couple of minutes or so.
Top left is a live video from a webcam. All of it is on top of a static background picture. Not shown here are messages, e.g. lost GPS signal, that are shown on top of the video.
Last but not least: a video screen grabber runs in the background and saves everything live to disk.
The program is not yet operational: I still have to do a lot of additions, corrections and refinements but the principle works.
To display all dynamic text and indicators I use the dzen2 utility (see https://sites.google.com/site/gotmor/dzen). Several dzen2 instances run continuously in the background, called from awk:
Code: Select all
awk -F"," '{
if ( /\$GPGGA/) program stuff
print stuff "dzen2 ........."
else if (/\$GPRMC/) other program stuff
print other stuff | "dzen2 ........."
print other stuff | "dzen2 ........"
else more program stuff
print more program stuff | "dzen2........."
}' GPS_data
A complication however is that awk runs in it's own shell, making passing of variables to the bash shell and back rather 'awk'ward. It becomes more complicated because dzen2 requires a lot of arguments, like text, colors, font, geometry etc. leading to a lot of work and lots of mistakes, corrections when optimizing the layout of the display. And then, I don't need all the dzen2 options and I do not use the menu option. Of course, dzen2 was not designed for this (it's a taskbar/tray/menu application) but it is the only usable application that I could find.
Now to my question: can anyone advise on a small, fast program that can be called from awk and prints text and images as per the attached image? I guess something in C, but I don't know how to do that (I had quite some trouble already with the little C-routine that provides the background image....).
What I need to handle:
- text
- text fg color
- font/fontsize
- images
- screen position x,y
Optional:
- text bg color
- blinking text
- .....
Stuff should stay on display until refreshed or killed. Small footprint is needed because several instances have to run at the same time
Some notes:
I can't use the usual gtk kind solutions . Reason is that the car display is only 800x600 (no touch) and of limited resolution. A rather large font is used (DejaVu Sans Bold 24) for clear visibility when driving. There isn't room for frames, decorations, dialogs and the like.
It is surprising that awk can do all that processing in almost no time on my old P3 1GHz 512 Mb laptop. Also thanks to Puppy, of course.
dzen2 is a great little program. It is flexible and general purpose. Each instance requires only about 1.1Mb. I have 10 instances running in my program.
I look forward to ideas.