diff options
author | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2012-09-04 16:25:02 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2012-09-04 16:25:02 +0200 |
commit | c570fdec56f6a4ad338fbc15dc41263e56f1b6a2 (patch) | |
tree | e51577f4502ffe23f3cefb23d3fc5956377df28b /bin | |
parent | ff660e44627550250801eb7b2011163e4ddc2b35 (diff) | |
download | dzen2-config-c570fdec56f6a4ad338fbc15dc41263e56f1b6a2.tar.gz dzen2-config-c570fdec56f6a4ad338fbc15dc41263e56f1b6a2.tar.xz dzen2-config-c570fdec56f6a4ad338fbc15dc41263e56f1b6a2.zip |
bin/dzen2_pgrp.sh: only display battery widget, if battery is available
Diffstat (limited to 'bin')
-rw-r--r-- | bin/dzen2_pgrp.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/dzen2_pgrp.sh b/bin/dzen2_pgrp.sh index 63fa325..531fe19 100644 --- a/bin/dzen2_pgrp.sh +++ b/bin/dzen2_pgrp.sh @@ -10,8 +10,11 @@ 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' & -OFFSET=$((OFFSET - 120)) -sh "${DIR}/bin/bat.sh" | dzen2 -xs ${SCREEN} -x ${OFFSET} -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 OFFSET=$((OFFSET - 120)) gcpubar -fg '#999' -bg '#444' -w 50 -h 7 -l "^i(${DIR}/icons/cpu.xbm) " | \ |