config/shell: export music directory globally
This commit is contained in:
parent
04cfa88b27
commit
bf1fd1dbb4
|
@ -1,5 +1,3 @@
|
|||
export DATA="$(test -d $HOME/data && echo $HOME/data || echo $HOME/daten)"
|
||||
export MUSIC="$DATA/music"
|
||||
export AUDIO="$DATA/audio"
|
||||
MUSIC_RAW="$AUDIO/songs/_raw"
|
||||
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
#!/bin/sh -e
|
||||
# launch my focus playlist
|
||||
playlistPath="$MUSIC/Playlists"
|
||||
# launch my focus playlist or find a matching playlist or song files
|
||||
# depends: mp mpc
|
||||
# env: MUSIC
|
||||
PLAYLISTS="$MUSIC/Playlists"
|
||||
mpc clear
|
||||
if test -z "$1"
|
||||
then mp -q "$playlistPath/focus.m3u"
|
||||
then mp -q "$PLAYLISTS/focus.m3u"
|
||||
else
|
||||
(find -L $playlistPath -iname "focus-$1.m3u" -print0 | grep --null-data . ||
|
||||
find -L $playlistPath -iname "$1.m3u*" -print0 | grep --null-data . ||
|
||||
(find -L $PLAYLISTS -iname "focus-$1.m3u" -print0 | grep --null-data . ||
|
||||
find -L $PLAYLISTS -iname "$1.m3u*" -print0 | grep --null-data . ||
|
||||
find -L $MUSIC -iname "*$1*" -prune -exec find {} -size +2M -type f -not -iregex ".*.\(jpe?g\|png\)" -print0 \; ) |
|
||||
xargs -0 mp -q
|
||||
fi
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
# Play given files on mpd, enabling playing of external files through symlinking and recursively resolving playlists
|
||||
# depends: xargs mpc realpath
|
||||
# depends: xargs realpath mpc
|
||||
# env: MUSIC
|
||||
MUSIC="${MUSIC:-$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/mpd/mpd.conf | grep music_directory | cut -d'"' -f2 | sed "s|~|$HOME|")}"
|
||||
PLAYLISTS="$MUSIC/Playlists"
|
||||
|
@ -31,5 +31,5 @@ else
|
|||
{ "$0" -r "$@" && mpc -q update --wait; } | #>/tmp/mp 2>&1
|
||||
xargs --delim='\n' mpc insert
|
||||
mpc ${quiet:-$next} play
|
||||
test -n "$next" && mpc $quiet next
|
||||
test -z "$next" || mpc $quiet next
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue