Skip to content

Commit

Permalink
add function mkplaylist() (#12)
Browse files Browse the repository at this point in the history
solves #11
  • Loading branch information
tatsumoto-ren authored Sep 12, 2024
1 parent a7689a9 commit 6efb8d8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions impd
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,18 @@ rotate() {
reshuffle
}

mkplaylist() {
local -r m3u_path=$immersionpod_dir/$current/impd.m3u

find "$immersionpod_dir/$current" \
-type f \
-printf '%P\n' \
-regextype posix-extended \
-iregex '.*\.(mp3|opus|ogg|m4a|wav|wma)$' |
shuf > "$m3u_path"
echo "created file '$m3u_path'"
}

grep_mpd_dir() {
# https://wiki.archlinux.org/index.php/Music_Player_Daemon#Configuration
grep -Pos 'music_directory\s*"?\K[^"]*(?="?)' -- ~/.config/mpd/mpd.conf
Expand Down

0 comments on commit 6efb8d8

Please sign in to comment.