summaryrefslogtreecommitdiff
path: root/scripts/music
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/music')
-rwxr-xr-xscripts/music24
1 files changed, 17 insertions, 7 deletions
diff --git a/scripts/music b/scripts/music
index a7fe836..d5eeaa3 100755
--- a/scripts/music
+++ b/scripts/music
@@ -1,7 +1,17 @@
#!/bin/sh
-# simple music selector with dmenu that uses and interacts with mpv
-# have a look at musiccmd, dwmblocks/sb_music and .local/etc/mpv/music
-# shellcheck disable=SC2012
+# . :-. .
+# author: ratakor <ratakor@disroot.org> :*==*%%%#%+=---:
+# :#%%%*+%#=+%*:.
+# created: Sat, 06 May 2023 18:44:52 +0200 :%%%. . -*%-
+# updated: Sat, 01 Jul 2023 18:12:52 +0200 =## . :#%*=:.
+# -#*#%:=#%%%#-
+# description: *:*%%%%%%%#-
+# simple music selector with dmenu that uses and .-#%%%%%%+
+# interacts with mpv. have a look at musiccmd, %%%--%%%%*-
+# dwmblocks/sb_music and .local/etc/mpv/music ;) ##%= +%%=:..
+# #* #%#
+# :# -==*
+# shellcheck disable=SC2012 # :: .:
MUSICDIR="${XDG_MUSIC_DIR:-$HOME/music}"
@@ -11,11 +21,11 @@ if [ "$1" = "--shuffle" ]; then
fi
MUSIC="${1:-$MUSICDIR/$(ls "$MUSICDIR" | dmenu -i -p "Play ")}"
-SCRIPT="$XDG_CONFIG_HOME/mpv/music/local.lua"
+SCRIPT="${XDG_CONFIG_HOME:-$HOME/.config}/mpv/music/local.lua"
if [ "$MUSIC" = "$MUSICDIR/urls" ]; then
MUSIC="$(cat "$MUSICDIR/urls/$(ls "$MUSICDIR/urls" | dmenu -i -p "Play ")")"
- SCRIPT="$XDG_CONFIG_HOME/mpv/music/online.lua"
+ SCRIPT="${XDG_CONFIG_HOME:-$HOME/.config}/mpv/music/online.lua"
fi
[ "$MUSIC" = "$MUSICDIR/" ] || [ -z "$MUSIC" ] && exit 1
@@ -26,5 +36,5 @@ if [ -z "$SHUFFLE" ] && [ -d "$MUSIC" ] || printf '%s' "$MUSIC" | grep -q playli
fi
printf 'stop\n' | socat - /tmp/mpvsocket 2> /dev/null
-mpv --vid=no --input-ipc-server=/tmp/mpvsocket --loop-playlist --volume=100\
- --ytdl-format="wv*+ba" --script="$SCRIPT" --shuffle="$SHUFFLE" "$MUSIC"
+mpv --vid=no --input-ipc-server=/tmp/mpvsocket --loop-playlist\
+ --ytdl-format=ba --script="$SCRIPT" --shuffle="$SHUFFLE" "$MUSIC"