From 9fea28480afc529456b959c50a1ee630520905b9 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 4 Sep 2012 16:15:32 +0200 Subject: bin/sound.sh: remove bashism --- bin/sound.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/sound.sh b/bin/sound.sh index 382c461..5153375 100644 --- a/bin/sound.sh +++ b/bin/sound.sh @@ -1,11 +1,11 @@ -function print_mute { +print_mute() { local stat VOL MUTE - stat=$(amixer -c0 get Master | grep "Front Left:") - VOL=$(sed 's/^.*\[\(.*\)%\].*$/\1/g' <<< "${stat}") - MUTE=$(sed 's/^.*\[\([^\[]*\)\]$/\1/g' <<< "${stat}") + stat=$(amixer -c0 get Master | grep "\(Mono\|Front Left\):") + VOL=$(echo "${stat}" | sed 's/^.*\[\(.*\)%\].*$/\1/g') + MUTE=$(echo "${stat}" | sed 's/^.*\[\([^\[]*\)\]$/\1/g') - if [ "${MUTE}" == "off" -o "${MUTE}" == "0" ] + if [ "${MUTE}" = "off" -o "${MUTE}" = "0" ] then echo "^tw()^fg(#FF0000)^i(${HOME}/.dzen2/icons/vol-mute.xbm)" else -- cgit v1.2.3