First Commit
This is a first dotfiles config. I think I have a lot more to add tho...
This commit is contained in:
26
bin/.bin/avol
Executable file
26
bin/.bin/avol
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Manage ALSA Master channel
|
||||
|
||||
test "$1" = "-h" && echo "usage `basename $0` [up|down|mute]" && exit 0
|
||||
|
||||
level() {
|
||||
amixer get Master | sed -n 's/^.*\[\([0-9]\+%\).*$/\1/p' | uniq
|
||||
|
||||
}
|
||||
|
||||
state() {
|
||||
amixer get Master | sed -n 's/^.*\[\(o[nf]\+\)]$/\1/p' | uniq
|
||||
|
||||
}
|
||||
|
||||
test $# -eq 0 && echo "`level` `state`" && exit 0
|
||||
|
||||
case $1 in
|
||||
up) amixer set Master ${2:-5}%+ >/dev/null ||autoalsaconfamixer;;
|
||||
down) amixer set Master ${2:-5}%- >/dev/null ||autoalsaconf;;
|
||||
mute) amixer set Master toggle >/dev/null ||autoalsaconf;;
|
||||
state|level) $1 ||autoalsaconf;;
|
||||
set) amixer set Master $2% >/dev/null ||autoalsaconf;;
|
||||
*) amixer set Master $1% >/dev/null ||autoalsaconf;;
|
||||
esac
|
Reference in New Issue
Block a user