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-12-21 22:27:23 +01:00
|
|
|
NOTIFY_CMD "shuffle started in background";
|
2022-12-06 08:01:44 +01:00
|
|
|
amused show | sort -R | amused load;
|
2023-12-21 22:27:23 +01:00
|
|
|
NOTIFY_CMD "shuffle finished";
|
2022-12-06 08:01:44 +01:00
|
|
|
)&}
|
|
|
|
amused_sort() {(
|
2023-12-21 22:27:23 +01:00
|
|
|
NOTIFY_CMD "sorting started in background"
|
2022-12-06 08:01:44 +01:00
|
|
|
amused show | sort -u | amused load
|
2023-12-21 22:27:23 +01:00
|
|
|
NOTIFY_CMD "sorting finished"
|
2022-12-06 08:01:44 +01:00
|
|
|
)&}
|
|
|
|
amused_load_tank() {(
|
2023-12-21 22:27:23 +01:00
|
|
|
NOTIFY_CMD "loading started in background"
|
2024-01-05 12:30:05 +01:00
|
|
|
ssh 192.168.1.20 "find /tank/pub/Audio_* -type f" | grep -Ev "jpg|jpeg|png|gif|/[Cc]over\." | amused load
|
2023-12-21 22:27:23 +01:00
|
|
|
NOTIFY_CMD "loading finished"
|
2022-12-06 08:01:44 +01:00
|
|
|
)&}
|
|
|
|
amused_load_local() {(
|
2023-12-21 22:27:23 +01:00
|
|
|
NOTIFY_CMD "loading started in background"
|
2024-01-05 12:30:05 +01:00
|
|
|
find /home/sdk/Music -type f | grep -Ev "jpg|jpeg|png|gif|/[Cc]over\." | amused load
|
2023-12-21 22:27:23 +01:00
|
|
|
NOTIFY_CMD "loading finished"
|
2022-12-06 08:01:44 +01:00
|
|
|
)&}
|
|
|
|
amused_cmd() {
|
|
|
|
amused "${@}"
|
2023-12-21 22:27:23 +01:00
|
|
|
NOTIFY_CMD "$(amused status | head -1 | cut -d'/' -f5-)"
|
2022-12-06 08:01:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
case "${SEL}" in
|
|
|
|
play) amused_cmd play; ;;
|
2024-01-05 12:30:05 +01:00
|
|
|
prev) amused_cmd prev; ;;
|
2022-12-06 08:01:44 +01:00
|
|
|
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
|