forked from colonelpanic/dotfiles
[Linux] Use pulsemixer for volume control
This commit is contained in:
@@ -10,7 +10,8 @@ function switch_sink_applications()
|
||||
}
|
||||
|
||||
current_default=$(pahelper.sh list | grep '*' | all_after_char ":" | xargs)
|
||||
environment_variable_exists USE_ONLY_ONE_PASINK && pahelper.sh "$current_default"
|
||||
environment_variable_exists USE_ONLY_O_PASINK && pahelper.sh "$current_default"
|
||||
|
||||
pulseaudio-ctl "$@"
|
||||
# XXX: this does not prevent volumes higher than 100
|
||||
pulsemixer "$@"
|
||||
pashowvolume
|
||||
|
@@ -60,7 +60,6 @@ function get_linux_distro {
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
function is_osx() {
|
||||
if command_exists uname; then
|
||||
case `uname` in
|
||||
@@ -82,3 +81,7 @@ function source_directory_files {
|
||||
source "$filename"
|
||||
done
|
||||
}
|
||||
|
||||
function min {
|
||||
[ $1 -le $2 ] && echo "$1" || echo "$2"
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ pasink() {
|
||||
pavolume () {
|
||||
pacmd list-sinks |
|
||||
awk '/^\s+name: /{indefault = $2 == "<'"$(pasink)"'>"}
|
||||
/^\s+volume: / && indefault {print $5; exit}'
|
||||
/^\s+volume: / && indefault {print $5; exit}' | grep -Eo "[0-9]*"
|
||||
}
|
||||
|
||||
paismuted () {
|
||||
@@ -24,7 +24,7 @@ pashowvolume () {
|
||||
if paismuted; then
|
||||
volnoti-show -m
|
||||
else
|
||||
volnoti-show "$(pavolume)"
|
||||
volnoti-show "$(min $(pavolume) 100)"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user