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
|
||||
# each arg is a script to create
|
||||
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"
|
||||
chmod +x "$name.fish"
|
||||
path resolve "$name.fish"
|
||||
|
|
|
@ -1,11 +1,22 @@
|
|||
#!/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
|
||||
if test (count $argv) -ne 0
|
||||
set sinks $argv
|
||||
end
|
||||
set -l current (pactl get-default-sink)
|
||||
|
||||
for i in sinks
|
||||
if test "$i" != "$current"
|
||||
pactl set-default-sink "$i"
|
||||
return 0
|
||||
set -l idx 0
|
||||
for i in $sinks
|
||||
if test "$i" = "$current"
|
||||
break
|
||||
end
|
||||
set idx (math $idx + 1)
|
||||
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