volume_down.sh 571 B

12345678910111213
  1. #!/usr/bin/env bash
  2. # pactl list sinks | grep '^[[:space:]]Volume:' | \
  3. # head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,'
  4. pactl set-sink-volume 0 -5%
  5. # current_volume=$(pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,')
  6. current_volume=$(pactl list sinks | grep '^[[:space:]]\(Volume:\)\|\(Громкость:\)' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,')
  7. notify-send -t 1000 -i dialog-information "Volume: $current_volume%"