diff options
author | Matthew Lemon <chaffinach+git@protonmail.ch> | 2022-01-06 14:14:21 +0000 |
---|---|---|
committer | Matthew Lemon <chaffinach+git@protonmail.ch> | 2022-01-06 14:14:21 +0000 |
commit | 1e52dd3bc62e45ba8b52e6f83feecb75234ed8f3 (patch) | |
tree | 8459eda09e9a54f9eea368b4e380a2e3f2a45210 | |
parent | b0d892ef73f47e1140d93c5cbea92fd6ea00a9cb (diff) |
music collection via dmenu
Diffstat (limited to '')
-rwxr-xr-x | music.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/music.sh b/music.sh new file mode 100755 index 0000000..9027c22 --- /dev/null +++ b/music.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +set -xe + +# nicked from https://hmbrg.xyz/log/2021/listen-to-audio-collection-via-dmenu-mpv/ +# ALl credit to them! Thank you. + +### ----------------------------------------------------------------- +### Global variables: +### ----------------------------------------------------------------- +DIR=~/annex/Music +PLAYER=mpv +DMENU='dmenu -i -l 30 -nb yellow -nf black' + +### ----------------------------------------------------------------- +### Select the subdirectory from which you want to play the MP3 file: +### ----------------------------------------------------------------- +albums=$(ls -1 "$DIR" | $DMENU -p "Select subdir: ") + +### ----------------------------------------------------------------- +### Select the subdirectory from which you want to play the MP3 file: +### ----------------------------------------------------------------- +album=$(ls -1 "$DIR/$albums" | $DMENU -p "Select album: ") + +### ----------------------------------------------------------------- +### Select MP3 file to play back: +### ----------------------------------------------------------------- +mp3=$(ls -1 "$DIR/$albums/$album/" | $DMENU -p "MP3 to play back: ") + +### ----------------------------------------------------------------- +### Play back selected MP3 file: +### ----------------------------------------------------------------- +$PLAYER "$DIR/$albums/$album/$mp3" --no-video + |