🎵 Play music in the terminal on Linux/MacOS.
Lately, I've been vibing to some synthwave tunes. YouTube is my go-to music source. Since I spend a lot of time in the MacOS terminal, I did not want to drain my battery by opening a web browser just to listen to music.
In order to do so I've wrote a short script that uses yt-dlp and mpv
#!/usr/env/bin bash
if [; then
fi
query=""
s_index=1
while ; do
|
s_index=
done
Don't forget to make the script executable with chmod +x pm.sh
and optionally, alias it to your shell profile for convenience, ex:
You can then use it simply by running
Enjoy the tunes! 🎶