elenapan/Scripts/volume.sh
elena 9a2fdf5c79 updated some scripts and uploaded some new ones
Former-commit-id: 6c9faff508
Former-commit-id: 17d19dad6bdde82ff8c2bcc983f87a49bb4a5e6f
Former-commit-id: 4f66d0d17a4bb9ceb3eedf158bae309fa71fb8b1
2017-12-07 09:45:55 +02:00

34 lines
659 B
Bash
Executable 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
# Icon only
# echo "  "
# Text only
echo "vol off"
else
# Text only
echo "vol $VOL"
# Icon only (simple)
# echo "  "
#Icon only (gradual)
# VOL="$(echo ${VOL%?})"
# if [ "$VOL" -ge "85" ]; then
# echo "  "
# elif [ "$VOL" -ge "20" ]; then
# echo "  "
# else
# echo "  "
# fi
fi