View Single Post
  #3  
Old 02-15-2016, 01:51 AM
Clever Clever is offline
Kobold

Clever's Avatar

Join Date: Aug 2011
Posts: 192
Default

Zenity works if you're willing to build a little. I threw together a shell script to tail the log file and pop up alerts based on a simple rules file as a proof, and while it's nowhere nearly GTT-grade out of the box, with a few hundred lines of python, perl, or even bash could be made every bit as functional.

LOGDIR=~/WineCellar/EQ/drive_c/EQ/Logs
LASTLOG=`ls -tr $LOGDIR | grep "eqlog_" | tail -n 1`
RULES=~/zenity_rules.eq

tail -f $LOGDIR/$LASTLOG | while read LINE ; do
LDAT=`echo $LINE | cut -f2 -d"]" | cut -f2 -d" "`
BUFF=`grep "$LDAT" $RULES`
if [ -n "$BUFF" ];then
BNAME=`echo $BUFF | cut -f1 -d","`
COUNT=`echo $BUFF | cut -f3 -d","`
START=$COUNT
until [ "$COUNT" -eq "0" ]; do
((COUNT-=1))
PERCENT=$((100-100*COUNT/START))
echo "#Time remaining$(echo "obase=60;$COUNT" | bc)"
echo $PERCENT
sleep 1
done | zenity --height=25 --width=250 --title "$BNAME" --progress --percentage=0 --text="" --no-cancel --auto-close

Within the rules file the text looks like this, with the comma-separated fields being timer name, text search, and timer seconds:

JBoots,Your feet feel quick.,1080

Zenity can be used to build entire applications, so it's just a matter of leveraging it from the script level. For something so simple as EQ timer displays I imagine it would make an outstanding first python project for somebody.
__________________
Clever - 60 Necromancer
Lesser Hippie of <Omni>
Composer of "From the Classic World"
Eldest 60 Iksar
Reply With Quote