AutoYADM commit: 2025-04-25 16:30:05
This commit is contained in:
parent
87ae9f44dd
commit
51717aed6d
2 changed files with 19 additions and 4 deletions
|
@ -5,6 +5,10 @@ function mkfish --description 'Make an executable fish script'
|
||||||
end
|
end
|
||||||
# each arg is a script to create
|
# each arg is a script to create
|
||||||
for name in $argv
|
for name in $argv
|
||||||
|
if test -f "$name.fish"
|
||||||
|
echo Skipping existing file...
|
||||||
|
continue
|
||||||
|
end
|
||||||
printf '#!/usr/bin/env fish'\n\n"echo $name" >"$name.fish"
|
printf '#!/usr/bin/env fish'\n\n"echo $name" >"$name.fish"
|
||||||
chmod +x "$name.fish"
|
chmod +x "$name.fish"
|
||||||
path resolve "$name.fish"
|
path resolve "$name.fish"
|
||||||
|
|
|
@ -1,11 +1,22 @@
|
||||||
#!/usr/bin/env fish
|
#!/usr/bin/env fish
|
||||||
|
argparse h/help -- $argv
|
||||||
|
if set -q _flag_h
|
||||||
|
echo "Cycle between pactl sinks specified as arguments."
|
||||||
|
end
|
||||||
|
|
||||||
set -l sinks alsa_output.usb-FIIO_FiiO_USB_DAC-E10-01.analog-stereo alsa_output.usb-Burr-Brown_from_TI_USB_Audio_DAC-00.analog-stereo
|
set -l sinks alsa_output.usb-FIIO_FiiO_USB_DAC-E10-01.analog-stereo alsa_output.usb-Burr-Brown_from_TI_USB_Audio_DAC-00.analog-stereo
|
||||||
|
if test (count $argv) -ne 0
|
||||||
|
set sinks $argv
|
||||||
|
end
|
||||||
set -l current (pactl get-default-sink)
|
set -l current (pactl get-default-sink)
|
||||||
|
|
||||||
for i in sinks
|
set -l idx 0
|
||||||
if test "$i" != "$current"
|
for i in $sinks
|
||||||
pactl set-default-sink "$i"
|
if test "$i" = "$current"
|
||||||
return 0
|
break
|
||||||
end
|
end
|
||||||
|
set idx (math $idx + 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set -l next_idx (math "($idx + 1)" % (count $sinks))
|
||||||
|
pactl set-default-sink $sinks[(math $next_idx + 1)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue