screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ANN: eventlogger for screen backticks


From: clemens fischer
Subject: ANN: eventlogger for screen backticks
Date: Sun, 14 Jun 2009 21:52:02 +0200
User-agent: tin/1.9.4-20090211 ("Rieclachan") (UNIX) (Linux/2.6.29-ARCH (i686))

Hi,

I've written a program called eventlogger.c[1] based on the newer posix
message queues[2].  It simply sets up a queue[3] and lets you place one
line of text into it.  In the other mode, without giving it text, it
will read out what's in the queue, highest priority messages first.

I use it to place machine data like memory-used, cpu-temperature, mail
alerts, wheather etc. at the lower right of the caption.  Advantage:
using queues will never "freeze" screen waiting for data, and you can
send many info lines without locking or serializing from a number of
other scripts/programs concurrently.

Believe me, I either used totally wrong search terms or there really was
no other implementation of such a simple thing (less than 400 lines of
C)!

The utility could be used for other purposes where asynchronous,
scriptable messages are needed, but ATM I use it only for screens
backtick status info.  Although I'm thinking of using it to send
commands to cooperating scripts ...

from my .screenrc:

  backtick 0 7 7 /root/bin/screen_backtick.sh -b0 -t0
  backtick 1 7 7 /root/bin/screen_backtick.sh -b1 -t33
  # the _caption_ is for windows, the _hardstatus_ is for entire screen
  caption always "%D %d.%m %{= Gk}%c%{-} %{-b}%{= wb}%-Lw%{= kr}%{+b}%n%f %t%? 
[%h]%?%{= wb}%{-b} %+Lw%{= kr} %{+b rY}%?%1`%:%{-b kG}%0`%?"

screen_backtick.sh is a very simple wrapper script, for applications not
needing beeps or central configuration of message queue files it is not
needed.  The "sensors" reading out /proc to aquire machine status info
are equally simple and use the same wrapper to enqueue their findings
with various priorities.  Eventlogger allows complete independence of
message sources, you could set permissions and owners of the queue files
such that there are producers with write-only access and read-only
consumers or whatever.


[1] http://ino-waiting.gmxhome.de/softwares.html
[2] see "man 7 mq_overview"
[3] "/bin/mount -t mqueue none /mq"


clemens





reply via email to

[Prev in Thread] Current Thread [Next in Thread]