From c03547585cc68ca0ab7a67eaa3b13263958109b7 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 8 Jul 2015 07:13:00 +0200 Subject: dzen2_pgrp: Also support pulseaudio restarting for chaning volume A long runing amixer keeps the device open and does not notice is the device is not there any more (restart of pulse). If the device appears afterwards, it does not fix it by it self, so we simply start a new amixer process for each change. --- bin/dzen2_pgrp.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/dzen2_pgrp.sh b/bin/dzen2_pgrp.sh index 0b9808c..dd9e628 100644 --- a/bin/dzen2_pgrp.sh +++ b/bin/dzen2_pgrp.sh @@ -6,7 +6,7 @@ SCREEN=1 # get width of screen OFFSET=$(${DIR}/bin/xinerama-resolution ${SCREEN} | cut -dx -f1) -CLOCK_WIDTH=$(textwidth "$FONT" "$(date)") +CLOCK_WIDTH=$(textwidth "$FONT" "$(LC_ALL=C 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' & @@ -25,9 +25,8 @@ OFFSET=$((OFFSET - 17)) ${DIR}/bin/pulse-dbus-receive.py | \ /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 & + ;button1=exec:amixer -q sset Master toggle;button3=exec:amixer -q sset Master 80%\ + ;button4=exec:amixer -q sset Master 2%+;button5=exec:amixer -q sset Master 2%-' & # 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' & -- cgit v1.2.3