2022-12-06 08:01:44 +01:00
|
|
|
#!/bin/sh
|
|
|
|
. $HOME/.bin/_config
|
|
|
|
|
|
|
|
showlist() {
|
|
|
|
printf '%s\n' \
|
|
|
|
"next
|
|
|
|
prev
|
|
|
|
play
|
|
|
|
stop
|
|
|
|
shuffle
|
|
|
|
sort
|
|
|
|
load tank
|
|
|
|
load local
|
|
|
|
---------
|
|
|
|
> $(amused status | head -1 | sed 's,/tank/pub/Audio_/,,g')
|
|
|
|
---------"
|
|
|
|
|
|
|
|
amused show | cut -d'/' -f5-
|
|
|
|
}
|
|
|
|
|
|
|
|
SEL="$( showlist | $DMENU_CMD -p Playlist -l 30)"
|
|
|
|
|
|
|
|
amused_shuffle() {(
|
2023-11-04 10:58:13 +01:00
|
|
|
notify-send "shuffle started in background";
|
2022-12-06 08:01:44 +01:00
|
|
|
amused show | sort -R | amused load;
|
2023-11-04 10:58:13 +01:00
|
|
|
notify-send "shuffle finished";
|
2022-12-06 08:01:44 +01:00
|
|
|
)&}
|
|
|
|
amused_sort() {(
|
2023-11-04 10:58:13 +01:00
|
|
|
notify-send "sorting started in background"
|
2022-12-06 08:01:44 +01:00
|
|
|
amused show | sort -u | amused load
|
2023-11-04 10:58:13 +01:00
|
|
|
notify-send "sorting finished"
|
2022-12-06 08:01:44 +01:00
|
|
|
)&}
|
|
|
|
amused_load_tank() {(
|
2023-11-04 10:58:13 +01:00
|
|
|
notify-send "loading started in background"
|
2022-12-06 08:01:44 +01:00
|
|
|
amused load < /home/sdk/.music.all.txt
|
2023-11-04 10:58:13 +01:00
|
|
|
notify-send "loading finished"
|
2022-12-06 08:01:44 +01:00
|
|
|
)&}
|
|
|
|
amused_load_local() {(
|
2023-11-04 10:58:13 +01:00
|
|
|
notify-send "loading started in background"
|
2022-12-06 08:01:44 +01:00
|
|
|
find ~/MusicSelection -type f | amused load
|
2023-11-04 10:58:13 +01:00
|
|
|
notify-send "loading finished"
|
2022-12-06 08:01:44 +01:00
|
|
|
)&}
|
|
|
|
amused_cmd() {
|
|
|
|
amused "${@}"
|
2023-11-04 10:58:13 +01:00
|
|
|
notify-send "$(amused status | head -1 | cut -d'/' -f5-)"
|
2022-12-06 08:01:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
case "${SEL}" in
|
|
|
|
play) amused_cmd play; ;;
|
|
|
|
prev) amused_cmd pref; ;;
|
|
|
|
stop) amused_cmd stop; ;;
|
|
|
|
next) amused_cmd next; ;;
|
|
|
|
shuffle) amused_shuffle; ;;
|
|
|
|
sort) amused_sort; ;;
|
|
|
|
load*tank) amused_load_tank; ;;
|
|
|
|
load*local) amused_load_local; ;;
|
|
|
|
*) amused_cmd jump "${SEL}"; ;;
|
|
|
|
esac
|