From 1572b865b6f352fb70c9747ce203c434a121db18 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner <2000sw@gmail.com> Date: Mon, 23 Feb 2015 22:48:08 +0100 Subject: [PATCH] debug textfeed --- textfeed.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/textfeed.sh b/textfeed.sh index f00fefc..d4656bf 100755 --- a/textfeed.sh +++ b/textfeed.sh @@ -1,6 +1,22 @@ #!/bin/sh -echo -n "Y " \ - | convert -extract 16x16+43+43 -background lightblue -fill blue -pointsize 21 text:- bmp3:- \ - | dd bs=1 skip=54 \ - | nc -u 172.22.239.182 8888 +HOST="172.22.239.182" +PORT=8888 +NC=$(which nc) + +DEBUG=0 +MESSAGE="Z" + +MESSAGE="$MESSAGE " +if [ "$DEBUG" = 0 ]; then + echo -n "$MESSAGE" \ + | convert -extract 16x16+43+43 -background lightblue -fill blue -pointsize 21 text:- bmp3:- \ + | dd bs=1 skip=54 \ + | "$NC" -u "$HOST" "$PORT" +else + echo -n "$MESSAGE" \ + | convert -extract 16x16+43+43 -background lightblue -fill blue -pointsize 21 text:- bmp3:- \ + > /tmp/debug.bmp + gpicview /tmp/debug.bmp +fi +