Skip to content

Instantly share code, notes, and snippets.

@amenpunk
Last active August 22, 2019 22:23
Show Gist options
  • Save amenpunk/564b5ef6423b4de2586fdab56232b295 to your computer and use it in GitHub Desktop.
Save amenpunk/564b5ef6423b4de2586fdab56232b295 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Si no tienes un playlist generado puedes generarlo de la siguiente manera:
# updatedb -l 0 -U [Music PATH] -o music.db
# Ejemplo: update -l 0 -u $HOME/Music -o music.db
#Adapted from by https://moc.daper.net/comment/6080#comment-6080
if [[ -z $(pgrep mocp) ]]; then
sh $HOME/.moc/mocp-tee && mocp -c
fi
# Select track(s) in external library (if plugged):
cd $HOME/Music || exit
playlist="$(locate -d "$HOME/music.db" -b "" | rofi -width 100 -dmenu -i -multi-select -p " ♪ ")"
# Prevent MOC from fooling if selection cancelled:
mocp -c -a -p "$playlist"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment