[Linux] A bunch of linux audio functions/improvements
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
is_osx && return
|
||||
|
||||
command_exists 'open' || command_exists 'xdg-open' && alias open='xdg-open'
|
||||
|
||||
pasink () {
|
||||
pacmd list-sinks | grep '* index' | get_cols ' -1'
|
||||
pacmd list-sinks | grep '\* index' | get_cols ' -1'
|
||||
}
|
||||
|
||||
pasink() {
|
||||
@@ -10,7 +12,22 @@ pasink() {
|
||||
|
||||
pavolume () {
|
||||
pacmd list-sinks |
|
||||
awk '/^\s+name: /{indefault = $2 == "<'$(pasink)'>"}
|
||||
awk '/^\s+name: /{indefault = $2 == "<'"$(pasink)"'>"}
|
||||
/^\s+volume: / && indefault {print $5; exit}'
|
||||
|
||||
}
|
||||
|
||||
paismuted () {
|
||||
pactl list sinks | grep "$(pasink)" -A 10 | grep Mute | grep -q yes
|
||||
}
|
||||
|
||||
pashowvolume () {
|
||||
if paismuted; then
|
||||
volnoti-show -m
|
||||
else
|
||||
volnoti-show "$(pavolume)"
|
||||
fi
|
||||
}
|
||||
|
||||
pashowinputbypid () {
|
||||
get_sink_input_info.hs | jq 'select(.application_process_id == "'"$1"'")'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user