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
|
|
|
|
|
2023-01-09 14:50:04 -05:00
|
|
|
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
|
2023-01-14 20:56:31 -05:00
|
|
|
[ -d "$target" ] && find "$fullpath" \( -iname "*.mp3" \
|
2022-12-28 21:12:43 -05:00
|
|
|
-o -iname "*.ogg" -o -iname "*.flac" \
|
2023-01-14 20:56:31 -05:00
|
|
|
-o -iname "*.m4a" \) -print0 | sort -z \
|
2023-01-09 14:50:04 -05:00
|
|
|
| xargs -0 deadbeef --queue -- 2>/dev/null
|
2022-02-26 14:04:55 -05:00
|
|
|
fi
|