diff options
author | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2012-09-04 16:24:24 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2012-09-04 16:24:24 +0200 |
commit | ff660e44627550250801eb7b2011163e4ddc2b35 (patch) | |
tree | ac73514f53a738f9c5074b9fad617b13041be6f4 /bin | |
parent | 142dc77652bc04b08dac8f35b24949d4fe6a3823 (diff) | |
download | dzen2-config-ff660e44627550250801eb7b2011163e4ddc2b35.tar.gz dzen2-config-ff660e44627550250801eb7b2011163e4ddc2b35.tar.xz dzen2-config-ff660e44627550250801eb7b2011163e4ddc2b35.zip |
bin/dzen2_pgrp.sh: adjust dzen2 instances with screen width
Diffstat (limited to 'bin')
-rw-r--r-- | bin/dzen2_pgrp.sh | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/bin/dzen2_pgrp.sh b/bin/dzen2_pgrp.sh index 05c186e..63fa325 100644 --- a/bin/dzen2_pgrp.sh +++ b/bin/dzen2_pgrp.sh @@ -1,19 +1,29 @@ #!/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' & +OFFSET=$((OFFSET - 120)) +sh "${DIR}/bin/bat.sh" | dzen2 -xs ${SCREEN} -x ${OFFSET} -w 120 -fn "${FONT}" -bg black -e 'button1=none' & -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' & -sh "${DIR}/bin/sound.sh" | dzen2 -xs 1 -x 1223 -tw 17 -w 100 -fn "${FONT}" -bg black -sa c -l 1 -e 'entertitle=uncollapse,unhide;leavetitle=collapse;button1=exec:amixer -q -c0 set Master toggle;button2=exec:pavucontrol;button3=exec:amixer -c0 -- set Master playback 80%;button4=exec:amixer -c0 -- set Master playback 2%+;button5=exec:amixer -c0 -- set Master playback 2%-' & +OFFSET=$((OFFSET - 17)) +sh "${DIR}/bin/sound.sh" | dzen2 -xs ${SCREEN} -x ${OFFSET} -tw 17 -w 100 -fn "${FONT}" -bg black -sa c -l 1 -e 'entertitle=uncollapse,unhide;leavetitle=collapse;button1=exec:amixer -q -c0 set Master toggle;button2=exec:pavucontrol;button3=exec:amixer -c0 -- set Master playback 80%;button4=exec:amixer -c0 -- set Master playback 2%+;button5=exec:amixer -c0 -- set Master playback 2%-' >/dev/null & + +# 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} ) & |