[Linux] Improved pavolume command
This commit is contained in:
parent
1edf66542f
commit
c7ead0ec0c
@ -4,7 +4,13 @@ pasink () {
|
|||||||
pacmd list-sinks | grep '* index' | get_cols ' -1'
|
pacmd list-sinks | grep '* index' | get_cols ' -1'
|
||||||
}
|
}
|
||||||
|
|
||||||
pavolume () {
|
pasink() {
|
||||||
pactl list sinks | grep '^[[:space:]]Volume:' | \
|
pacmd stat | awk -F": " '/^Default sink name: /{print $2}'
|
||||||
head -n $(( $(pasink) + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,'
|
}
|
||||||
|
|
||||||
|
pavolume () {
|
||||||
|
pacmd list-sinks |
|
||||||
|
awk '/^\s+name: /{indefault = $2 == "<'$(pasink)'>"}
|
||||||
|
/^\s+volume: / && indefault {print $5; exit}'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user