changed volume to use pactl

This commit is contained in:
2017-04-22 21:54:49 -06:00
parent 6cca93eaf5
commit 74340f27b9
+8 -6
View File
@@ -3,26 +3,28 @@
# notification to twmn using twmnc
step=1
sink="@DEFAULT_SINK@"
if [[ $# -eq 1 ]]; then
case $1 in
"up")
amixer set Master $step%+
pactl set-sink-mute $sink false
pactl set-sink-volume $sink +$step%
direction='increased to ';;
"down")
amixer set Master $step%-
pactl set-sink-volume $sink -$step%
direction='decreased to ';;
"mute")
amixer set Master toggle;;
pactl set-sink-mute $sink toggle;;
*)
echo "Invalid option";;
esac
fi
muted=`amixer get Master | grep "Front Left:" | awk '{print $6}'`
vol=`amixer get Master | grep "Front Left:" | awk '{print $5}' | tr -d '[]'`
muted=`pactl list sinks | grep "Mute" | awk '{print $2}'`
vol=`pactl list sinks | grep "front-left" | awk '{print $5}'`
if [[ $muted == "[off]" ]]; then
if [[ $muted == "no" ]]; then
twmnc -t 'volume' -c 'muted' -d 100
else
twmnc -t 'volume' -c "${direction}${vol}" -d 100