tRewrote the popup to be simpler - scripts - various script and utils
 (HTM) git clone git://z3bra.org/scripts
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
 (DIR) commit 2fcf341c2a4f8781502eacc6c9ab02d4aa28cf73
 (DIR) parent aee2a38fe1df0c8947aacfe12a7f40209a15f72b
 (HTM) Author: z3bra <willy@mailoo.org>
       Date:   Wed, 19 Mar 2014 13:30:34 +0100
       
       Rewrote the popup to be simpler
       
       Diffstat:
         M popup                               |      37 +++++++++++++++++++------------
       
       1 file changed, 23 insertions(+), 14 deletions(-)
       ---
 (DIR) diff --git a/popup b/popup
       t@@ -4,26 +4,35 @@
        # Create a small popup with the given text
        
        TEXT='none'
       -GEOM="32x6+20+20"
       -PRETTY="toilet --gay -f smblock"
       -SLEEP=1
       -
       -volume() {
       -    VOLUME=`amixer sget Master |
       -            sed -n 's/^.*\[\([0-9/]*%\)\].*\[\(o[nf]\+\)\]$/\1 (\2)/p'| uniq`
       -    echo $VOLUME
       -}
       +SLEEP=3
        
        spawn() {
       -    #urxvt -geometry $GEOM -e sh -c "echo;echo ' $@'|$PRETTY; sleep $SLEEP"
       -    (echo "\c\f8 $@";sleep $SLEEP)|bar -w 96
       +    (echo "\c\f7 $@";sleep $SLEEP) | bar -w 120 -x 1790 -b -y 270
        }
        
       -test -z "$1" && exit 1
       +test "$#" -lt 1 && exit 1
        
        case $1 in
       -    volume) TEXT=`volume`;;
       -    *) TEXT=$@;;
       +    volume)
       +        TEXT=`amixer sget Master |
       +            sed -n 's/^.*\[\([0-9/]*%\)\].*\[\(o[nf]\+\)\]$/\1 (\2)/p' |
       +            uniq`
       +        ;;
       +    battery)
       +        BATC=`cat /sys/class/power_supply/BAT1/capacity`
       +        BATS=`cat /sys/class/power_supply/BAT1/status`
       +        TEXT="$BATC% ($BATS)"
       +        ;;
       +    mail)
       +        TEXT="`fcount ~/var/mail/INBOX/new` new mail!"
       +        ;;
       +    date)
       +        TEXT=`date "+%d/%m/%y \(%H:%M\)"`
       +        ;;
       +
       +    *) TEXT="$@" ;;
        esac
        
       +# can be *REALLY* annoying
       +# beep -f 1500 -d 20 -l 100
        spawn "$TEXT"