-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplay.sh
More file actions
executable file
·27 lines (20 loc) · 766 Bytes
/
play.sh
File metadata and controls
executable file
·27 lines (20 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# --- configuration: -------------
PLAYER="mplayer -shuffle -msglevel all=-1:demux=4:statusline=5 -playlist -vo null"
MUSIC_DIR="/all/hudba/"
# --- end of configuration -------
PLAYLIST=$(mktemp "/tmp/play_XXXXXX.pls")
if [ -d "${1}" ];
then
SELECTED=$(readlink -f "${1}")
else
SELECTED=$(find /all/hudba/ -maxdepth 1 -type d|grep -v "/all/hudba/$"|sort -R|head -n 1)
fi
find "${SELECTED}" -iname "*.ogg" -o -iname "*.mp3" -printf "%p\\n" >> ${PLAYLIST}
echo "**** Playlist ${PLAYLIST} created with $(wc -l ${PLAYLIST}) songs"
${PLAYER} "${PLAYLIST}"
rm "${PLAYLIST}"
echo "**** Playlist ${PLAYLIST} removed"
# |-print0 |xargs --null --no-run-if-empty ${PLAYER}
#${PLAYER} $LIST
#${PLAYER} $(find "${SELECTED}" -iname "*.ogg" -o -iname "*.mp3")