summaryrefslogtreecommitdiffstats
path: root/bin/dzen2_pgrp.sh
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-11-28 22:43:08 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2012-11-28 22:43:08 +0100
commit0990820adb2e10c069c971188101af39515b61f0 (patch)
tree783a6b4146f845dbac00b5aa598a84357d5f1fc5 /bin/dzen2_pgrp.sh
parent4e773bd7c60dfed11c5a5a8df4115607ea9d523d (diff)
parent3283cd6e1f1e1e93192d7cb649ea16332afa0844 (diff)
downloaddzen2-config-0990820adb2e10c069c971188101af39515b61f0.tar.gz
dzen2-config-0990820adb2e10c069c971188101af39515b61f0.tar.xz
dzen2-config-0990820adb2e10c069c971188101af39515b61f0.zip
Merge branch 'master' of ssh://git.animux.de/dzen2-config
* 'master' of ssh://git.animux.de/dzen2-config: clock.sh: fix highlight of multiple holidays in one line bin/dzen2_pgrp.sh: only display battery widget, if battery is available bin/dzen2_pgrp.sh: adjust dzen2 instances with screen width bin/clock.sh: use gcal if available bin: ignore external binaries bin/sound.sh: remove bashism Conflicts: bin/dzen2_pgrp.sh bin/sound.sh
Diffstat (limited to 'bin/dzen2_pgrp.sh')
-rw-r--r--bin/dzen2_pgrp.sh27
1 files changed, 20 insertions, 7 deletions
diff --git a/bin/dzen2_pgrp.sh b/bin/dzen2_pgrp.sh
index 83f801e..0b9808c 100644
--- a/bin/dzen2_pgrp.sh
+++ b/bin/dzen2_pgrp.sh
@@ -1,25 +1,38 @@
#!/bin/sh
DIR="${HOME}/.dzen2/"
FONT="-*-terminus-medium-r-normal-*-12-*-*-*-*-*-*-*"
+SCREEN=1
-cat $* | dzen2 -xs 1 -x 0 -w 1223 -ta l -fn "${FONT}" -bg black -e 'button1=none' &
-MAIN=$!
+# get width of screen
+OFFSET=$(${DIR}/bin/xinerama-resolution ${SCREEN} | cut -dx -f1)
+
+CLOCK_WIDTH=$(textwidth "$FONT" "$(date)")
+OFFSET=$((OFFSET - $CLOCK_WIDTH - 20))
+sh "${DIR}/bin/clock.sh" | dzen2 -xs ${SCREEN} -x ${OFFSET} -w $(($CLOCK_WIDTH + 20)) -fn "${FONT}" -bg black -l 17 -p -sa c -e 'button1=exec:xscreensaver-command -lock;button3=exec:xcalendar;button2=exec:xscreensaver-command -prefs;onstart=collapse;entertitle=uncollapse,unhide;leavetitle=collapse' &
-sh "${DIR}/bin/bat.sh" | dzen2 -xs 1 -x 1360 -w 120 -fn "${FONT}" -bg black -e 'button1=none' &
+if [ -e "/proc/acpi/battery/BAT0" ]; then
+ # if battery is available, display battery widget
+ OFFSET=$((OFFSET - 120))
+ sh "${DIR}/bin/bat.sh" | dzen2 -xs ${SCREEN} -x ${OFFSET} -w 120 -fn "${FONT}" -bg black -e 'button1=none' &
+fi
-sh "${DIR}/bin/clock.sh" | dzen2 -xs 1 -x 1480 -w 200 -fn "${FONT}" -bg black -l 17 -p -sa c -e 'button1=exec:xscreensaver-command -lock;button3=exec:xcalendar;button2=exec:xscreensaver-command -prefs;onstart=collapse;entertitle=uncollapse,unhide;leavetitle=collapse' &
-
+OFFSET=$((OFFSET - 120))
gcpubar -fg '#999' -bg '#444' -w 50 -h 7 -l "^i(${DIR}/icons/cpu.xbm) " | \
sed -u 's/#D56F6C/#ff0000/' | \
- dzen2 -xs 1 -x 1240 -w 120 -fn "${FONT}" -bg black -e 'button1=none' &
+ dzen2 -xs ${SCREEN} -x ${OFFSET} -w 120 -fn "${FONT}" -bg black -e 'button1=none' &
+OFFSET=$((OFFSET - 17))
${DIR}/bin/pulse-dbus-receive.py | \
- /home/alex/dev/dzen/dzen2 -xs 1 -x 1223 -tw 17 -w 100 -fn "${FONT}" -bg black -sa c -l 1 \
+ /home/alex/dev/dzen/dzen2 -xs ${SCREEN} -x ${OFFSET} -tw 17 -w 100 -fn "${FONT}" -bg black -sa c -l 1 \
-e 'entertitle=uncollapse,unhide;leavetitle=collapse;button2=exec:pavucontrol\
;button1=print:sset Master toggle;button3=print:sset Master 80%\
;button4=print:sset Master 2%+;button5=print:sset Master 2%-' | \
amixer -sq &
+# fill the rest of the screen with the information from xmonad
+cat $* | dzen2 -xs ${SCREEN} -x 0 -w ${OFFSET} -ta l -fn "${FONT}" -bg black -e 'button1=none' &
+MAIN=$!
+
# kill bars on new RandR config
( ${DIR}/bin/xrandr-notify && kill ${MAIN} ) &