Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
executable file 25 lines (20 sloc) 961 Bytes
#!/usr/bin/env bash
#
# dmenu script for playing yt on shuffle
#
# Author: Rafael Cavalcanti - rafaelc.org
readonly options="$(cat <<-END
⏲ Watch later#https://www.youtube.com/playlist?list=WL
♫ Music#--no-keep-open https://www.youtube.com/playlist?list=PLG0ys6U09lfmgmxd8gw7fRbGzENTcaCE-
♫ Music - Watch later#https://www.youtube.com/playlist?list=PLG0ys6U09lfnE3SbOnT_BV4NSo2O9xZ90
♫ Music - HDex#https://www.youtube.com/playlist?list=PLG0ys6U09lfk8yQNjZmfc_IgjyBu71dfi
 CC#https://www.youtube.com/playlist?list=PLG0ys6U09lfnC0103-nm77pcfPuldFfE7
END
)"
readonly chosen="$(cut -d# -f1 <(printf "%s" "$options") | dmenu -p "yt playlists:" "$@")"
[[ -z "$chosen" ]] && exit
readonly args="$(grep "^${chosen}#" <(printf "%s" "$options") | cut -d# -f2)"
user_args=""
readonly no_resume="$(printf "No\nYes" | dmenu -p "Start over?" "$@")"
[[ $no_resume == "Yes" ]] && user_args="$user_args --no-resume-playback"
mpv --shuffle $user_args $args