commit 44aa9c26a6fac3eeeb880911ac9a88e4ca68945d
parent 4712da7a20994bb37a3ac554107db8ec7aadf22c
Author: mrgrouse <bdmfegys@duck.com>
Date: Sun, 12 May 2024 15:46:00 -0400
volume.sh: update volume.sh to use wpctl, and add get argument for getting current volume
Diffstat:
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/extras/volume.sh b/extras/volume.sh
@@ -10,7 +10,8 @@
# $./volume.sh mute
function get_volume {
- pamixer --get-volume
+ #pamixer --get-volume
+ wpctl get-volume @DEFAULT_AUDIO_SINK@
}
#function is_mute {
@@ -23,7 +24,8 @@ function send_notification {
# https://en.wikipedia.org/wiki/Box-drawing_character
bar=$(seq -s "─" $(($volume / 2)) | sed 's/[0-9]//g')
# Send the notification
- dunstify -i $HOME/Pictures/sysicon/volume-up.png -t 8000 -r 2593 -u normal -h int:value:"$volume" "Volume: ${volume}%"
+ #dunstify -i $HOME/Pictures/sysicon/volume-up.png -t 8000 -r 2593 -u normal -h int:value:"$volume" "Volume: ${volume}%"
+ dunstify -i $HOME/Pictures/sysicon/volume-up.png -t 8000 -r 2593 -u normal -h int:value:"$volume" "${volume}%"
#notify-send "volume: $volume%"
}
@@ -33,10 +35,14 @@ function send_notification1 {
# https://en.wikipedia.org/wiki/Box-drawing_character
bar=$(seq -s "─" $(($volume / 2)) | sed 's/[0-9]//g')
# Send the notification
- dunstify -i $HOME/Pictures/sysicon/volume-down.png -t 8000 -r 2593 -u normal -h int:value:"$volume" "Volume: ${volume}%"
+ dunstify -i $HOME/Pictures/sysicon/volume-down.png -t 8000 -r 2593 -u normal -h int:value:"$volume" "${volume}%"
#notify-send "volume: $volume%"
}
case $1 in
+ get)
+ get_volume
+ send_notification
+ ;;
up)
# Set the volume on (if it was muted)
#amixer -D pulse set Master on > /dev/null