Skip to content

Instantly share code, notes, and snippets.

@sprngr
Last active June 2, 2019 14:28
Show Gist options
  • Save sprngr/402473bb64bf798b09a8a3f4acc7baf1 to your computer and use it in GitHub Desktop.
Save sprngr/402473bb64bf798b09a8a3f4acc7baf1 to your computer and use it in GitHub Desktop.
cdrip - a simple cd ripping utility script
#!/usr/bin/env bash
# cdrip - a simple cd ripping utility script
# by sprngr
# Usage:
# $ cdrip "Album Name"
# 📁 Creating album: Album Name
# 💿 Ripping contents...
# ⏰ Time Elapsed: 0:06:03
# 🔧 Fixing ripped track permissions
# ⏏ Done! Ejecting CD
# Dependencies: pv (available in most package repos)
# This is where my CDs get auto mounted
# May need to update this location for your own purposes.
disc='/run/user/1000/gvfs/cdda:host=sr0'
album=$1
mkdir "$album"
echo "📁 Creating album: $album"
echo "💿 Ripping contents..."
cp -R $disc/* "$album" | pv -t -N "⏰ Time Elapsed"
echo "🔧 Fixing ripped track permissions"
chmod 0644 "${album}"/*
echo "⏏ Done! Ejecting CD"
eject
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment