diff options
author | Matthew Lemon <chaffinach+git@protonmail.ch> | 2022-01-06 20:40:12 +0000 |
---|---|---|
committer | Matthew Lemon <chaffinach+git@protonmail.ch> | 2022-01-06 20:40:12 +0000 |
commit | 19703abeb91bf6601219567c0d9f19d8655d213b (patch) | |
tree | 605e98be1a8138ea1c303832019db9edeec31337 | |
parent | 2d418fd614835d3b54a0c87a7f1b0de8b507c7fb (diff) | |
parent | 0de1dd4efc60be36b7516342c5644c09095702da (diff) |
Merge branch 'master' of gitlab.com:yulqen/bash-scripts
Diffstat (limited to '')
-rwxr-xr-x | music.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/music.sh b/music.sh new file mode 100755 index 0000000..c9c5842 --- /dev/null +++ b/music.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# 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 #b96dbf -nf white' + +### ----------------------------------------------------------------- +### 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 + |