scripts

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

commit 8594c74c5b1622a13b099927f22b96ab443bf7d8
parent 86c31c8df2743c68ae09369dd7e763efc38b4bec
Author: z3bra <willy@mailoo.org>
Date:   Tue Jan 28 17:23:37 +0100

popup

Diffstat:
popup | 29+++++++++++++++++++++++++++++
1 file changed, 29 insertions(+), 0 deletions(-)
diff --git a/popup b/popup @@ -0,0 +1,29 @@ +#!/bin/sh +# +# z3bra - (c) wtfpl 2014 +# 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 +} + +spawn() { + #urxvt -geometry $GEOM -e sh -c "echo;echo ' $@'|$PRETTY; sleep $SLEEP" + (echo "\c\f8 $@";sleep $SLEEP)|bar -w 96 +} + +test -z "$1" && exit 1 + +case $1 in + volume) TEXT=`volume`;; + *) TEXT=$@;; +esac + +spawn "$TEXT"