tchanged look & feel for volumebar and popups - scripts - various script and utils
(HTM) git clone git://z3bra.org/scripts
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit c8a584d1efdaa927bb17613cbc35030f15fccf6e
(DIR) parent 72e574d65d5636dd69efa9896d807409a87dc68e
(HTM) Author: z3bra <willy@mailoo.org>
Date: Mon, 30 Mar 2015 23:05:25 +0200
changed look & feel for volumebar and popups
Diffstat:
M popup | 32 ++++++++++++++++----------------
M volume | 14 +++++++-------
M volumebar | 6 +++---
3 files changed, 26 insertions(+), 26 deletions(-)
---
(DIR) diff --git a/popup b/popup
t@@ -6,23 +6,28 @@
TEXT='none'
SLEEP=3
+ftn="profont" # XFT name of the font, for txtw
+fts="12" # size of the said font
+
# bar options
-font='-*-stlarch-medium-r-*-*-10-*-*-*-*-*-*-*'
-font="$font,-*-profont-medium-*-*--12-*-*-*-*-*-*-1"
+#font='-*-stlarch-medium-r-*-*-10-*-*-*-*-*-*-*'
+#font="-*-profont-medium-*-*--12-*-*-*-*-*-*-1"
+font="-*-creep-*-*-*--16-*-*-*-*-*-*-1"
bg="#ff161616"
fg="#ffffffff"
hl="#ff443232"
-IFS=' x' read x y <<< `xrandr | grep '*' | sed 1q | awk '{print $1}'`
+x=$(wattr w `lsw -r`)
+y=$(wattr h `lsw -r`)
-width=300
+width=180
height=20
-offx=10
+
+#offx=10
offy=10
-#offx=$(( x - $width - 10 ))
-#offy=$(( y - $height - 10 ))
+offx=$(( x - 14 - $width ))
+#offy=$(( y - $height - 10 ))
-title=""
geom=${width}x${height}+${offx}+${offy}
usage() {
t@@ -30,8 +35,7 @@ usage() {
}
spawn() {
- prefix="%{F${fg}} ${title} %{F-}"
- (echo "%{l}${prefix} %{r}$@ ";sleep $SLEEP) | bar -d -g $geom -f $font -B $bg -F $fg
+ (echo "%{c}$@";sleep $SLEEP) | lemonbar -d -g $geom -f $font -B $bg -F $fg
}
loop() {
t@@ -41,15 +45,13 @@ loop() {
done) | bar -g $geom -f $font -B $bg -F $fg
}
-test "$#" -lt 1 && exit 1
+test "$#" -lt 1 &&
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
t@@ -60,6 +62,4 @@ shift $(( OPTIND - 1 ));
TEXT="$@"
FUNC="echo $TEXT"
-# that beep can be *REALLY* annoying
-test -n "$BEEP" && beep -f 1500 -d 20 -l 100
-test -n "$LOOP" && loop "$FUNC" || spawn "$TEXT"
+spawn "$TEXT"
(DIR) diff --git a/volume b/volume
t@@ -29,11 +29,11 @@ state() {
test $# -eq 0 && echo "`level`" && exit 0
case $1 in
- -h) usage ;;
- -s) state ;;
- -l) level ;;
- +) amixer set $CHANNEL 5%+ >/dev/null;;
- -) amixer set $CHANNEL 5%- >/dev/null;;
- !) amixer set $CHANNEL toggle >/dev/null;;
- *) amixer set $CHANNEL $1 >/dev/null;;
+ -h) usage ;;
+ -s) state ;;
+ -l) level ;;
+ up|+) amixer set $CHANNEL 5%+ >/dev/null;;
+ down|-) amixer set $CHANNEL 5%- >/dev/null;;
+ toggle|!) amixer set $CHANNEL toggle >/dev/null;;
+ *) amixer set $CHANNEL $1 >/dev/null;;
esac
(DIR) diff --git a/volumebar b/volumebar
t@@ -1,8 +1,8 @@
#!/bin/sh
-C1='%{F#ffffffff}+'
-C2='%{F#ff333333}+'
-C3='%{F#ffcc6464}+'
+C1='%{F#ffffffff}|'
+C2='%{F#ff333333}|'
+C3='%{F#ffcc6464}|'
test "$(volume -s)" = "off" && C1="$C3"