1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2024-11-29 18:13:40 +00:00
dotfiles/bin/hitolo

25 lines
592 B
Bash
Executable file

#!/bin/sh
HIFI=~/Music/HiFi
LOFI=/tmp/foo
test -f /usr/share/man/man3/Parallel::ForkManager.3 || sudo eopkg it perl-parallel-forkmanager
if test $# -eq 0; then
mkdir "$LOFI"
fusermount -u "$LOFI"
ifuse --documents com.foobar2000.mobile "$LOFI"
else
LOFI=$1
fi
if ! test -d "$LOFI"; then
cd "$HIFI" || exit 1
fd -t d -x mkdir -p "$LOFI"/{}
fd -e flac -x opusenc --bitrate 256 {} "$LOFI"/'{.}'.opus
fi
# https://github.com/smxi/acxi/raw/stable/acxi
acxi -s "$HIFI" -d "$LOFI" -o opus -q 256 --clean sync -F 16 -c mp3,m4a,opus
fusermount -u "$LOFI"
rmdir "$LOFI"