Last active
May 18, 2020 21:38
-
-
Save ffd8/3343c3f710652d559e34a9db286df204 to your computer and use it in GitHub Desktop.
mp3dir - simple mp3 dir player for CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# mp3dir | |
# cc teddavis.org 2020 | |
# play dir of mp3's using afplay in MacOS terminal. | |
# | |
# install: | |
# `cd /usr/local/bin` | |
# `touch mp3dir` | |
# `open mp3dir` | |
# copy + paste these entire contents, save + close file | |
# `chmod +x mp3dir` | |
# | |
# use: | |
# `mp3dir *drag+drop dir*` | |
# enjoy! | |
# | |
# exit: | |
# `CTRL + C` | |
# use current dir, or if provided, cd to that dir | |
if [ "$#" -ne 0 ] | |
then | |
cd "$1" | |
fi | |
# loop through dir and play mp3's one after another | |
for i in *.mp3; do | |
if [ -e "$i" ]; then | |
afplay "$i" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mp3dir
Want a super basic mp3 player using your CLI interface (Terminal in MacOS)?
No need for pause/skip/scrub/like/etcetc?? Then mp3dir is for you!
install
Open Terminal (or CLI tool of choice), run the following commands one at a time:
cd /usr/local/bin
// sets CLI working path to local binaries dirtouch mp3dir
// creates blank file called mp3diropen mp3dir
// opens file in text editorchmod +x mp3dir
// makes executableAlternatively,
Download Zip
above, open Terminal:cd /usr/local/bin
// sets CLI working path to local binaries dirchmod +x mp3dir
// makes executableusage
mp3dir *drag+drop mp3 dir*
exit
CTRL + C
// quits CLI process