aboutsummaryrefslogtreecommitdiff
path: root/scripts/commands/:play-next
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/commands/:play-next')
-rwxr-xr-xscripts/commands/:play-next17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/commands/:play-next b/scripts/commands/:play-next
new file mode 100755
index 0000000..255fb9f
--- /dev/null
+++ b/scripts/commands/:play-next
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+musicdir=$HOME/Downloads/music;
+
+ls_songs() {
+ cd $musicdir;
+ find -follow | while read l; do [[ -f "$l" ]] && echo "$l"; done | sed 's/^\.\///';
+}
+
+song=$(ls_songs | sort | dmenu -p "Song :: ");
+
+[[ -z "$song" ]] && exit 1;
+
+mpc insert "file://$musicdir/$song";
+
+[[ "$(~/scripts/music/player.sh get_play_state)" == "Stopped" ]] && mpc play;
+update-dwmblock music;