以下工作:
# play file1 and then file 2:
mpv "file1" "file 2"
# use fzf to select a file and play that file:
mpv "$(fdfind . /path/to/Music | fzf)" 现在,fzf -m允许多选择。但是,以下内容不起作用:
mpv "$(fdfind . /path/to/Music | fzf -m)" #select at least 2 files here首先,我认为问题在于fzf -m返回以换行符分隔的选择,例如:
file1
file 2所以我尝试了一些sed/ awk的东西:
fdfind . /path/to/Music | fzf -m |
sed 's/^/"/;s/$/"/' | #double quotes every line
awk 1 ORS=' ' | #replace newline with ' '
head -c -1 | #delete the last ' '将其格式设置为:
"file1" "file 2"这也没用。因此,我还使用以下方法尝试了kdialog:
mpv "$(kdialog --getopenfilename --multiple /path/to/Music/)" #select at least 2 files here但不起作用。但是,kdialog-open-files.lua用户脚本对我来说很好!
我认为我在将参数传递给mpv时犯了一个错误,因为下面(很明显)是这样工作的:
mpv "$(fdfind . /path/to/Music | fzf)" "$(fdfind . /path/to/Music | fzf)"发布于 2022-08-30 06:40:12
是从这个堆叠溢出柱找到的
fdfind . Music/ | fzf -m | xargs -d "\n" mpv您还可以通过这种方式将命令行参数传递给mpv:
fdfind . Music/ | fzf -m | xargs -d "\n" mpv --volume=50 --loop-playlist=inf等。
https://stackoverflow.com/questions/73537588
复制相似问题