use switch and filter vol better
This commit is contained in:
@ -2,10 +2,13 @@
|
|||||||
CARD=$(pactl list cards short | grep '1f.3' | awk '{print $2}')
|
CARD=$(pactl list cards short | grep '1f.3' | awk '{print $2}')
|
||||||
CURRENT_SINK=$(pactl info | grep "Default Sink:")
|
CURRENT_SINK=$(pactl info | grep "Default Sink:")
|
||||||
dunstctl close-all
|
dunstctl close-all
|
||||||
if [ "$CURRENT_SINK" = *"iec958"* ]; then
|
case $CURRENT_SINK in
|
||||||
pactl set-card-profile $CARD output:analog-stereo
|
*iec958*)
|
||||||
notify-send "analog out active" -i :
|
pactl set-card-profile $CARD output:analog-stereo
|
||||||
else
|
notify-send "analog out active" -i :
|
||||||
pactl set-card-profile $CARD output:iec958-stereo
|
;;
|
||||||
notify-send "digital out active" -i :
|
*)
|
||||||
fi
|
pactl set-card-profile $CARD output:iec958-stereo
|
||||||
|
notify-send "digital out active" -i :
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|||||||
12
bin/st-vol
12
bin/st-vol
@ -1,7 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
VOLUME=$(wpctl get-volume @DEFAULT_SINK@)
|
VOLUME=$(wpctl get-volume @DEFAULT_SINK@)
|
||||||
if [ $VOLUME =~ "MUTED" ]; then
|
case $VOLUME in
|
||||||
echo " MUTED"
|
*MUTED*)
|
||||||
fi
|
echo " MUTED";;
|
||||||
VOLUME=$(echo $VOLUME | sed s/"Volume: 0."//g)
|
*)
|
||||||
echo " $VOLUME"
|
VOLUME=$(echo $VOLUME | awk '{print $2}' | sed 's/^0//;s/\.//')
|
||||||
|
echo " $VOLUME";;
|
||||||
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user