tAdded a -t switch to set the prefix (title) - scripts - various script and utils
(HTM) git clone git://z3bra.org/scripts
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit 8fb9272aef956dda032ece1ee063f172d537556a
(DIR) parent 81b4a7047266917c8677b511fbd4aa14481f8857
(HTM) Author: z3bra <willy@mailoo.org>
Date: Fri, 27 Jun 2014 14:18:22 +0200
Added a -t switch to set the prefix (title)
Diffstat:
M popup | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
---
(DIR) diff --git a/popup b/popup
t@@ -9,27 +9,28 @@ SLEEP=3
# bar options
font='-*-stlarch-medium-r-*-*-10-*-*-*-*-*-*-*'
font="$font,-*-gohufont-medium-*-*--11-*-*-*-*-*-iso10646-1"
-bg="#00000000"
+bg="#ff333333"
fg="#ffffffff"
-hl="#ff333333"
+hl="#ff6ac0fd"
IFS=' x' read x y <<< `xrandr | grep '*' | sed 1q | awk '{print $1}'`
-width=144
-height=20
+width=300
+height=30
offx=$(( x/2 - $width - 74 ))
-offx=740
-offy=10
+offx=1610
+offy=1040
+title=""
geom=${width}x${height}+${offx}+${offy}
usage() {
- echo "`basename $0` [-hb] [-d delay] [-g WxH+X+Y] [TEXT]"
+ echo "`basename $0` [-hb] [-d delay] [-t title] [-g WxH+X+Y] [TEXT]"
}
spawn() {
- prefix='%{F#fffffe00} %{F-}'
- (echo "%{l}${prefix} $@";sleep $SLEEP) | bar -g $geom -f $font -B $bg -F $fg
+ prefix="%{F${hl}} ${title} %{F-}"
+ (echo "%{l}${prefix} %{r}$@ ";sleep $SLEEP) | bar -g $geom -f $font -B $bg -F $fg
}
loop() {
t@@ -105,12 +106,13 @@ group() {
test "$#" -lt 1 && exit 1
-while getopts ":bd:g:hl" opt; do
+while getopts ":bd:g:hlt:" opt; do
case $opt in
b) BEEP=1 ;;
l) LOOP=1 ;;
d) SLEEP=$OPTARG ;;
g) geom=$OPTARG ;;
+ t) title=$OPTARG ;;
h) usage; exit 0 ;;
*) usage; exit 1 ;;
esac