diff --git a/Scripts/music.sh b/Scripts/music.sh index bcadb30..55bbe12 100755 --- a/Scripts/music.sh +++ b/Scripts/music.sh @@ -23,7 +23,6 @@ LIMIT=30 #SEPERATOR=" -- " #SEPERATOR=" ~~~ " SEPERATOR=" ~~ " -#SEPERATOR="  " #SEPERATOR=" <> " SEPERATOR_LENGTH="$(echo ${#SEPERATOR})" diff --git a/Scripts/volume.sh b/Scripts/volume.sh index 61c6d9e..eb7f36a 100755 --- a/Scripts/volume.sh +++ b/Scripts/volume.sh @@ -1 +1,16 @@ -amixer get Master | grep "${snd_cha}" | awk -F'[]%[]' '/%/ {if ($7 == "off") {print " \n"} else {printf " %d%%\n", $2}}' \ No newline at end of file +#!/bin/bash + +# For Alsa +#amixer get Master | grep "${snd_cha}" | awk -F'[]%[]' '/%/ {if ($7 == "off") {print "  "} else {printf "%d%% ", $2}}' +# + + +# For pulse +VOL="$(pactl list sinks | grep "Volume: " | awk '{print $5}' | head -1)" +MUTE="$(pactl list sinks | grep -i "mute" | head -1 | awk '{print $2}')" + +if [[ "$MUTE" != "no" ]]; then + echo "  " +else + echo "$VOL " +fi