mirror of
https://github.com/sahinakkaya/dotfiles.git
synced 2024-12-23 15:49:40 +01:00
25 lines
502 B
Bash
25 lines
502 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
MUSIC="$HOME/music"
|
||
|
|
||
|
|
||
|
function get_music() {
|
||
|
IFS=$'\n'
|
||
|
for i in $(ls "$MUSIC" | grep -v 'thumbs'); do
|
||
|
name="${i%.*}"
|
||
|
echo -en "${i}\0icon\x1f${MUSIC}/thumbs/${name}.png\n"
|
||
|
done
|
||
|
}
|
||
|
|
||
|
|
||
|
if [ -z "$@" ]; then
|
||
|
echo -en "Shuffle\0icon\x1fmedia-playlist-shuffle\n"
|
||
|
get_music
|
||
|
else
|
||
|
if [ "$1" = "Shuffle" ]; then
|
||
|
$HOME/scripts/music/mpv-controller.sh start shuffle &
|
||
|
else
|
||
|
$HOME/scripts/music/mpv-controller.sh start "${MUSIC}/$1" &
|
||
|
fi
|
||
|
fi
|