-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmusic
executable file
·33 lines (24 loc) · 1.44 KB
/
music
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
## By Davoud Arsalani
## https://github.com/davoudarsalani/scripts
## https://github.com/davoudarsalani/scripts/blob/master/music
## https://raw.githubusercontent.com/davoudarsalani/scripts/master/music
## https://davoudarsalani.ir
source "$HOME"/main/scripts/gb
source "$HOME"/main/scripts/gb-audacious
function no_such_dir {
msgc 'ERROR' "no such directory as <span color=\"${orange}\">\$HOME/main/music/${directory}</span>" "$HOME"/main/linux/themes/delete-w.png
exit
}
function update_audacious {
"$HOME"/main/scripts/awesome-widgets audacious
}
readarray -t directories < <(find "$HOME"/main/music -mindepth 1 -maxdepth 1 -type d | sort)
directory="$(pipe_to_rofi "${directories[@]##*/}" 'header=music')" || exit 37
[ -d "$HOME"/main/music/"$directory" ] || no_such_dir
turn_on_shuffle; sleep 0.1
clear_playlist ; sleep 0.1
msgn 'playing' "<span color=\"${orange}\">${directory}</span>" "$HOME"/main/linux/themes/musical-note-w.png
readarray -t files < <(find "$HOME"/main/music/"$directory" -mindepth 1 -type f -iname '*.mp3' | sort) ## <--,-- -maxdepth 1 is not needed here
audacious -E "${files[@]}" ## |-- NOTE do NOT add cut -c 3- (it would open multiple error boxes
update_audacious ## '-- saying 'Error reading *****. No such file or directory')