From 9383c9b8deb70ad6e79edb56f8c15b7fa4ad62ea Mon Sep 17 00:00:00 2001 From: xerus2000 <27jf@pm.me> Date: Fri, 4 Sep 2020 12:05:10 +0200 Subject: [PATCH] config/music: Update music path --- .config/shell/music | 14 +++++++++++++- .local/bin/focus | 6 ++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.config/shell/music b/.config/shell/music index dccc6d3..4592ab4 100644 --- a/.config/shell/music +++ b/.config/shell/music @@ -1,11 +1,23 @@ -MUSIC="/home/janek/daten/musik" +MUSIC="/home/janek/daten/music" AUDIO="/home/janek/daten/audio" MUSIC_RAW="$audio_folder/songs/_raw" +edpl() { + $EDITOR $(find $MUSIC/Playlists -iname "$1\.*" | grep . || find $MUSIC/Playlists -iname "$1*") +} + makePl() { echo ${2:-empty} >$1.m3u8 } makePls() { i=1; while test $i -le ${1:-9}; do makePl "${2:-Ω}$i" "empty$i"; ((i++)); done } +fixPl() { + sed -i 's/\/storage\/AAAA-AAAA\/musik/../g' * +} +plCd() { + dir=${2:-cd} + mkdir $dir + cat $1 | python -c "import sys, urllib as ul; [sys.stdout.write(ul.unquote_plus(l)) for l in sys.stdin]" | sed '=' | sed -r 's/^[0-9]$/0\0/' | sed -r "N; s/(.*)\n(.*\/[0-9 ]*(.*))/'\2'\n'$dir\/\1 \3'/" | xargs -L 2 cp +} findsongs() { find -regextype posix-extended -maxdepth 1 -type f -regex "${1:-.*\.(mp3|flac|wav|m4a)}" -printf "%P\n" diff --git a/.local/bin/focus b/.local/bin/focus index 2649f19..e784323 100755 --- a/.local/bin/focus +++ b/.local/bin/focus @@ -1,4 +1,6 @@ #!/bin/sh -playlistPath="$HOME/daten/music/Playlists" -vlc $(find $playlistPath -iname "Focus$1.m3u8" | grep . || find $playlistPath -iname "$1.m3u8") >/dev/null 2>&1 & +MUSIC="$HOME/daten/music" +playlistPath="$MUSIC/Playlists" +result="$(test "$1" && (find $playlistPath -iname "focus-$1.m3u8" | grep . || find $playlistPath -iname "$1.m3u*" | grep . || find $MUSIC -iname "*$1*") || echo "$playlistPath/focus.m3u8" )" +killall -q vlc; sleep 1; vlc --qt-start-minimized --loop --random "$result" >/dev/null 2>&1 &