URI:
       twrappop - scripts - various script and utils
  HTML git clone git://z3bra.org/scripts
   DIR Log
   DIR Files
   DIR Refs
       ---
       twrappop (583B)
       ---
            1 #!/bin/sh
            2 
            3 # fifo that we'll use to feed the popups
            4 test -p /tmp/popup.fifo || mkfifo /tmp/popup.fifo
            5 test -d /tmp/popup.d || mkdir /tmp/popup.d
            6 
            7 w=190
            8 h=20
            9 x=1200
           10 y=10
           11 
           12 find_place() {
           13     NUM=$(fcount /tmp/popup.d)
           14     for n in `seq 0 $NUM`; do
           15         test ! -f /tmp/popup.d/$n && echo $n && return
           16     done
           17     echo $NUM
           18 }
           19 
           20 mkpop() {
           21     local f=$1
           22 
           23     touch /tmp/popup.d/$f
           24     popup -g ${w}x${h}+${x}+$((y + (h+y) * f)) $f ${message}
           25     rm /tmp/popup.d/$f
           26 }
           27 
           28 # get messages from the fifo
           29 tail -f /tmp/popup.fifo |
           30 while IFS= read -r message; do
           31     mkpop $(find_place) &
           32 done