scripts

various script and utils
git clone git://z3bra.org/scripts
Log | Files | Refs

commit 2e0a6261e9bee32d21a51c4c1168b31cee6ae5eb
parent 8978083896701bf52995d95c24e7d9234b023c93
Author: z3bra <willy@mailoo.org>
Date:   Thu Feb  5 14:10:07 +0100

finally a working popup wrapper !

Diffstat:
wrappop | 34++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/wrappop b/wrappop @@ -2,24 +2,34 @@ # fifo that we'll use to feed the popups test -p /tmp/popup.fifo || mkfifo /tmp/popup.fifo +test -d /tmp/popup.d || mkdir /tmp/popup.d -w=150 +w=190 h=20 -x=1930 +x=1200 y=10 -n=-1 +find_place() { + NUM=$(fcount /tmp/popup.d) + for n in `seq 0 $NUM`; do + test ! -f /tmp/popup.d/$n && echo $n && return + done + echo $NUM +} + +mkpop() { + local f=$1 + + touch /tmp/popup.d/$f + + ~/bin/popup -g ${w}x${h}+${x}+$((y + (h+y) * f)) $f ${message} + + rm /tmp/popup.d/$f +} # get messages from the fifo tail -f /tmp/popup.fifo | while IFS= read -r message; do - # increment the counter - n=$((n + 1)) - - # display the popup under the others - { - ~/bin/popup -g ${w}x${h}+${x}+$((y + (h+y) * n)) $n ${message} - # decrement the counter - n=$((n - 1)) - } & + mkpop $(find_place) & done +