#!/usr/bin/env bash set -euo pipefail # Script Name: tunes # Description: Play audio files with mpv (supports shuffle, playlists, URLs) # Source: https://evanhahn.com/scripts-i-wrote-that-i-use-all-the-time/ # Usage: tunes song.mp3 # tunes --shuffle ~/music/ # tunes https://youtube.com/watch?v=xxxxx if ! command -v mpv &>/dev/null; then echo "Error: mpv not found. Install with: sudo apt install mpv" >&2 exit 1 fi exec mpv --no-video --ytdl-format=bestaudio "$@"