cruxports/deadbeef/dbq

20 lines
520 B
Plaintext
Raw Normal View History

2022-02-26 14:04:55 -05:00
#!/bin/sh
# Description: Add files or directories to the deadbeef queue
#
# Dependencies: deadbeef audio player
#
# Shell: sh
# Author: John McQuah
target="$1"
2022-02-26 14:04:55 -05:00
fullpath="$2/$target"
if [ -r "$target" ]; then
[ -n "$(ps --no-header -C deadbeef-main)" ] || exit 0
[ -f "$target" ] && deadbeef --queue -- "$fullpath" 2>/dev/null
[ -d "$target" ] && find "$fullpath" \( -iname "*.mp3" \
2022-12-28 21:12:43 -05:00
-o -iname "*.ogg" -o -iname "*.flac" \
-o -iname "*.m4a" \) -print0 | sort -z \
| xargs -0 deadbeef --queue -- 2>/dev/null
2022-02-26 14:04:55 -05:00
fi