Mittwoch, April 30, 2008

simulating LCD display in xterm

I like to add a display to the PC I do some automated work on (reading floppies, ripping CD's). To write to the display I will use LCDd. This daemon controls the display. One ore more client will send simple ASCII commands and messages via TCP.

To test my client and encounter the display size I use the curses driver to simulate the display via xterm.

In /etc/LCDd.conf at the [curses] section set topleftx and toplefty to 0. Set size to the size to try (e.g. 20x4).

Start a xterm to simulate the display.
xterm -name lcdproc +sb -geometry 22x6 -e /usr/sbin/LCDd -c /etc/LCDd.conf -d curses &
Make sure that no LCDd is running as this prevents the start of the new one. Set the xterm geometry to the one of LCDd.conf (+2 on x and y for the border).

To do some tests by hand connect to LCDd with telnet and type:

telnet localhost 13666
hello
client_set -name mytest
screen_add scr1
widget_add scr1 str1 string
widget_set scr1 str1 1 1 "first test output"

For more information see Chapter 3. The LCDproc client language of the LCDProc Developer Guide.

Keine Kommentare: