mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
completions: fix pacmd completions when using pipewire-pulse.
In such cases, `pacmd help` prints No PulseAudio daemon running, or not running as session daemon. to stderr, which ends up printed to the user terminal.
This commit is contained in:
parent
aeabc76b2e
commit
3ac2242c68
|
@ -1,13 +1,13 @@
|
|||
# Pulseaudio's pacmd
|
||||
# This covers the most useful commands
|
||||
set -l commands (pacmd help | string match -r '^ +[-\w]+' | string trim)
|
||||
set -l commands (pacmd help 2>/dev/null | string match -r '^ +[-\w]+' | string trim)
|
||||
complete -f -c pacmd
|
||||
complete -f -c pacmd -w pactl
|
||||
|
||||
# These descriptions are a bit wordy and unnecessary
|
||||
# Sample: set-source-port Change the port of a source (args: index|name, port-name)
|
||||
# Or: list-source-outputs List source outputs
|
||||
complete -f -c pacmd -n "not __fish_seen_subcommand_from $commands" -a "(pacmd help | string match ' *' | string trim | string replace -r '\s+' '\t')"
|
||||
complete -f -c pacmd -n "not __fish_seen_subcommand_from $commands" -a "(pacmd help 2>/dev/null | string match ' *' | string trim | string replace -r '\s+' '\t')"
|
||||
|
||||
# Since we wrapped pactl, we can also use functions defined there
|
||||
complete -f -c pacmd -n "__fish_seen_subcommand_from describe-module" -a '(__fish_pa_complete_type modules)'
|
||||
|
|
|
@ -12,7 +12,7 @@ set -l ctlcommands stat info list exit {upload,play,remove}-sample {load,unload}
|
|||
|
||||
# HACK: This is the list of commands from pacmd - used so we can use complete -w there
|
||||
if command -sq pacmd
|
||||
set commands (pacmd help | string match -r '^ +[-\w]+' | string trim)
|
||||
set commands (pacmd help 2>/dev/null | string match -r '^ +[-\w]+' | string trim)
|
||||
else
|
||||
set commands $ctlcommands
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user