From d6f818743b2602500c2b4945588e1e4571aa2c03 Mon Sep 17 00:00:00 2001 From: iAmInAction <83808704+iAmInActions@users.noreply.github.com> Date: Wed, 20 Jul 2022 09:40:06 +0200 Subject: [PATCH] Added an icon and fixed shuffle on BSD systems. --- midify.png | Bin 0 -> 2757 bytes midify.sh | 26 +++++++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 midify.png diff --git a/midify.png b/midify.png new file mode 100644 index 0000000000000000000000000000000000000000..cbba7d3bf26f18c33538d0feb31e4a77cdc77875 GIT binary patch literal 2757 zcmY*bc{J3E7yr&?#u#Q8O4LJn$r6&LBFl_*imW5M=}{(3rmTtjj_e6POLp4ul3{*| z?1p;D8zCdglIh8oB{i}{<4wQi{Lb%>d+#~-em>{ibM86!^GUWpZ6%3TKm!0ENwzk3 z6jktNpu|M^nekb!sE9MH-9i9Bd*9E1M3$L^i<-z#vaJPj8VQ$>KZ=ax_5lFek8DnK zjvQGm_MyqW+tX#T79|mT+tuceTD_F=b(|}LsM5b0_u;+NY)853|N=qzTdKNMS4Funq9%VyarL+(lf7xAwPlIPTr>J6) zQYR4QOfo;2Zjg25(IZEx9s+1g)np^y!bAU9X>j99F9Qu&o44hYG$8Xx3w!|*4jW~@ zQr|hJvW(D0kJZ^$ltYrb)>}Eoca&VqXoq}&2ynE1E|mt{D-;^&0t-ljpO&jF-1<2iSv2q{pbDOr(&w1MI?k72bQ6j{U&exzBk!SUkkS6H zpMGI<5Q@`7#6_(p<|L=&|jLpa({!+=>A4 zoWPM`(_`}fTiG3IYi zw*9F!tEzR(4@&oYq)tlr_=s&;*nP{++bdLAFd$}Y^B)j=#P`T}tL}t6|GFgSw#}ql zDso*ZX1+k;GcCnjlJlw*Uo3NI^?pGOB!BoYpW46Ex(t+iCpktM@Mu--(UCWuCOSM$Gr6g9yt_;1L5fOG;%udn_4>SWP53OK;3lW_0{Y3F8Oz+BK#fRRcvV9u+Q_$ZuPe@fpb5M`YZOg?6%4=YtWoxk5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VS%&?6u_|XSinN# ziM08%jb;-o;<^tG_G+Qb7B5Pz;UR$bWQlTbykFa+;BQ_jrn+h^`(yx-_5it|n`zhw zd7O6HnePWOQ!#2zdL z1ojqNrB`+#}jSGH|d|L!^4~?YVqo?(lO#iwYD=#4(+t$ z)B(|OUL;wz5`aGZOX0Sfh@buC+$q1DPhVcW3yurhpED=up7}@)jHJYXAG5a?B!b*);h(2v z04(ZX1_N>E8m3`juHW)3unaPQNW-qj@t64S&5xtv#Y8LNQ zD`xY1)l>!057hlXgEfW;z%m4jc7u;E`cv|ecM!5h4V%(YU>!$c%m_WsK~s+}L7k1r xL+K3?dNquif#Qx /dev/null + then + jot -w %i -r 1 $1 $(($2 + 1)) + fi + if command -v shuf &> /dev/null + then + shuf -i $1-$2 -n 1 + fi +} + # Get a random line of a file # Usage: $(getlineoffile ) getlineoffile () { MAXLINE=$(sed -n '$=' "$1") - LINE=$(shuf -i 1-$MAXLINE -n 1) + LINE=$(genrandinrange 1 $MAXLINE) echo $(sed "${LINE}q;d" "$1") } @@ -90,7 +103,7 @@ play_playlist () { do PLFILE="$MIDIFYLOCAL/lists/$PLIST.mm3u" MAXLINE=$(sed -n '$=' "$PLFILE") - LINE=$(shuf -i 1-$MAXLINE -n 1) + LINE=$(genrandinrange 1 $MAXLINE) MFILE=$(sed "${LINE}q;d" "$PLFILE") play_song $MIDIFYLOCAL/midi/$MFILE sleep 1 @@ -102,7 +115,7 @@ play_playlist () { do PLFILE=$TEMP/playlist.mm3u MAXLINE=$(sed -n '$=' "$PLFILE") - LINE=$(shuf -i 1-$MAXLINE -n 1) + LINE=$(genrandinrange 1 $MAXLINE) MFILE=$(sed "${LINE}q;d" "$PLFILE") curl -q $MIDIFYSERVER/midi/$MFILE > $TEMP/$MFILE play_song $TEMP/$MFILE @@ -119,8 +132,11 @@ play_song () { timidity -A 50 "$1" >/dev/null elif [ "$MIDIPLAYER" = "2" ] then - pioplemidi-cli "$1" -nl -fp -frb -s + playmidi "$1" elif [ "$MIDIPLAYER" = "3" ] + then + pioplemidi-cli "$1" -nl -fp -frb -s + elif [ "$MIDIPLAYER" = "4" ] then $MIDIPROG "$1" else