mirror of
https://github.com/Phantop/dotfiles
synced 2024-11-22 23:02:46 +00:00
25 lines
624 B
Fish
Executable file
25 lines
624 B
Fish
Executable file
#!/usr/bin/fish
|
|
set HIFI ~/Music/HiFi
|
|
set LOFI /tmp/foo
|
|
test -f /usr/share/man/man3/Parallel::ForkManager.3 || sudo eopkg it perl-parallel-forkmanager
|
|
|
|
if test $argv
|
|
set LOFI $argv
|
|
else
|
|
mkdir $LOFI
|
|
fusermount -u $LOFI
|
|
ifuse --documents com.foobar2000.mobile $LOFI
|
|
end
|
|
|
|
if not test -d $LOFI
|
|
cd $HIFI
|
|
fd -t d -x mkdir -p $LOFI/{}
|
|
fd -e flac -x opusenc --bitrate 256 {} $LOFI/{.}.opus
|
|
end
|
|
|
|
set args -s $HIFI -d $LOFI -o opus -q 256 --clean sync -F 16 -c mp3,m4a,opus
|
|
acxi $args || wget https://github.com/smxi/acxi/raw/stable/acxi -O- -o/dev/null | perl -- - $args
|
|
|
|
fusermount -u $LOFI
|
|
rmdir $LOFI
|