summaryrefslogtreecommitdiffstats
path: root/bin/sound.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sound.sh')
-rw-r--r--bin/sound.sh10
1 files 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