Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # set 100% for all channels; don't print STDOUT;
- amixer -D pulse sset Master 100% 1>/dev/null
- # print result
- echo -ne "\nbefore:\n"
- amixer
- # prepare for nice comparation in `vimdiff`
- amixer_a=$(echo "before:"; amixer)
- # 100 times parallel decrase volume for all channels by 1%
- # don't print STDOUT; don't print STDERR
- # it's working also with, for example 1%-, but
- # I choose changing by number according to
- # https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting#Volume_adjustment_does_not_work_properly
- for x in {1..100}
- do
- ( amixer -D pulse sset Master 700- 1>/dev/null 2>/dev/null ) &
- done
- # wait for for in ugly way... but KISS, that's only simulation ;)
- sleep 3s
- # print result
- echo -ne "\nafter:\n"
- amixer
- # prepare for nice comparation in `vimdiff`
- amixer_b=$(echo "after:"; amixer)
- # nice comparation in `vimdiff`
- vimdiff <(echo "$amixer_a") <(echo "$amixer_b")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement