dotfiles

personal configurations for my systems and programs
git clone git@git.eonndev.com/dotfiles.git
Log | Files | Refs

changeVolume (570B)


      1 #!/bin/bash
      2 # changeVolume
      3 
      4 # Arbitrary but unique message id
      5 msgId="2983"
      6 
      7 # Change the volume using pulse
      8 if [ "$1" = m ]; then
      9 	/usr/bin/pactl set-sink-mute 0 toggle
     10 	dunstify -a "changeVolume" -u low -r "$msgId" \
     11 	"Mute toggled"
     12 	exit 0
     13 fi
     14 /usr/bin/pactl set-sink-volume 0 "$1"
     15 
     16 # Query pactl
     17 volume="$(pactl list sinks |grep "Volume: f" |awk -v FS="(/|/)" '{print $2}')"
     18 # Show the volume notification
     19 dunstify -a "changeVolume" -u low -r "$msgId" \
     20 "Volume: ${volume}"
     21 
     22 # Play the volume changed sound
     23 # canberra-gtk-play -i audio-volume-change -d "changeVolume"