From c570fdec56f6a4ad338fbc15dc41263e56f1b6a2 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 4 Sep 2012 16:25:02 +0200 Subject: bin/dzen2_pgrp.sh: only display battery widget, if battery is available --- bin/dzen2_pgrp.sh | 7 +++++-- 1 file 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) " | \ -- cgit v1.2.3