tAdded a few options to popups - scripts - various script and utils
HTML git clone git://z3bra.org/scripts
DIR Log
DIR Files
DIR Refs
---
DIR commit dfc09a32b2fbf50723256aa947c1f9c9fad3629c
DIR parent f04cecc3a072248cfee17911953e0ab234c16270
HTML Author: z3bra <willy@mailoo.org>
Date: Tue, 25 Mar 2014 08:22:45 +0100
Added a few options to popups
Diffstat:
M popup | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
---
DIR diff --git a/popup b/popup
t@@ -6,12 +6,27 @@
TEXT='none'
SLEEP=3
+usage() {
+ echo "`basename $0` [-h] [-b] [-d <duration>] <any text..>"
+}
+
spawn() {
- (echo "\c\f7 $@";sleep $SLEEP) | bar -w 120 -x 1790 -b -y 270
+ (echo "\c\f7 $@";sleep $SLEEP) | bar -w 120 -x 1790 -b -y 270 &
}
test "$#" -lt 1 && exit 1
+while getopts ":bd:h" opt; do
+ case $opt in
+ b) BEEP=1 ;;
+ d) SLEEP=$OPTARG ;;
+ h) usage; exit 0 ;;
+ *) usage; exit 1 ;;
+ esac
+done
+
+shift $(( OPTIND - 1 ));
+
case $1 in
volume)
TEXT=`amixer sget Master |
t@@ -34,5 +49,5 @@ case $1 in
esac
# can be *REALLY* annoying
-# beep -f 1500 -d 20 -l 100
+test -n "$BEEP" && beep -f 1500 -d 20 -l 100
spawn "$TEXT"