summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2015-07-08 07:13:00 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2015-07-08 07:13:00 +0200
commitc03547585cc68ca0ab7a67eaa3b13263958109b7 (patch)
treefc55443e4c09ecf1fde7779aa54fcad005a5fec4
parent63cf3cb3d47563e3fdcd2a70bd49649d126645f4 (diff)
downloaddzen2-config-c03547585cc68ca0ab7a67eaa3b13263958109b7.tar.gz
dzen2-config-c03547585cc68ca0ab7a67eaa3b13263958109b7.tar.xz
dzen2-config-c03547585cc68ca0ab7a67eaa3b13263958109b7.zip
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.
-rw-r--r--bin/dzen2_pgrp.sh7
1 files 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' &