dotfiles

*nix config files
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

commit 5db14e8bac297991c988a61dd36c504e312708d5
parent e96350dfde5ee556036273560e13723304bba279
Author: pyratebeard <root@pyratebeard.net>
Date:   Mon, 22 May 2023 16:13:41 +0100

cmus add random album script

Diffstat:
Acmus/bin/ara | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/cmus/bin/ara b/cmus/bin/ara @@ -0,0 +1,24 @@ +#!/bin/bash +# ██████ ██████ ██████ +# ░░░░░░██ ░░██░░█ ░░░░░░██ +# ███████ ░██ ░ ███████ +# ██░░░░██ ░██ ██░░░░██ +# ░░████████░███ ░░████████ +# ░░░░░░░░ ░░░ ░░░░░░░░ +# a d d r a n d o m a l b u m + +# default to adding one album +[ $# -eq 0 ] && num=1 || num=$1 + +# set path to music and read into array +library_dir="$HOME/lib/music/" +readarray -d '' library < <(find ${library_dir} -mindepth 2 -maxdepth 2 -type d -print0) + +# get some randomness +RANDOM=$$$(date +%s) + +# add _n_ random albums to cmus library +for n in $(seq 1 ${num}) ; do + random_album=${library[$RANDOM % ${#library[@]}]} + cmus-remote -C "add ${random_album}" +done