tpopup - scripts - various script and utils
(HTM) git clone git://z3bra.org/scripts
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit 8594c74c5b1622a13b099927f22b96ab443bf7d8
(DIR) parent 86c31c8df2743c68ae09369dd7e763efc38b4bec
(HTM) Author: z3bra <willy@mailoo.org>
Date: Tue, 28 Jan 2014 17:23:37 +0100
popup
Diffstat:
A popup | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/popup b/popup
t@@ -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"