diff --git a/api b/api index 4962d49007..98e42be057 100755 --- a/api +++ b/api @@ -89,6 +89,40 @@ generate_logo() { #display colorized Pi-Apps logo in terminal ${darkgreen} ${black} ${darkgreen} ${black} ${darkgreen} ${default}" fi } + +generate_splashscreen() { #Place 10 random app icons on the loading screen for the next time Pi-Apps launches + + #get 10 random apps. Some are exempted because they don't display well. + local apps="$(list_apps local | grep -v 'Raspi2png\|template\|YouTubuddy' | shuf)" + + local app1="$(sed -n 1p <<<"$apps")" + local app2="$(sed -n 2p <<<"$apps")" + local app3="$(sed -n 3p <<<"$apps")" + local app4="$(sed -n 4p <<<"$apps")" + local app5="$(sed -n 5p <<<"$apps")" + local app6="$(sed -n 6p <<<"$apps")" + local app7="$(sed -n 7p <<<"$apps")" + local app8="$(sed -n 8p <<<"$apps")" + local app9="$(sed -n 9p <<<"$apps")" + local app10="$(sed -n 10p <<<"$apps")" + + #display the chosen apps + #echo "$apps" | head -n 10 + + sed "s_IMAGE0_$(base64 "${DIRECTORY}/apps/${app1}/icon-64.png" -w 0)_g ; \ + s_IMAGE1_$(base64 "${DIRECTORY}/apps/${app2}/icon-64.png" -w 0)_g ; \ + s_IMAGE2_$(base64 "${DIRECTORY}/apps/${app3}/icon-64.png" -w 0)_g ; \ + s_IMAGE3_$(base64 "${DIRECTORY}/apps/${app4}/icon-64.png" -w 0)_g ; \ + s_IMAGE4_$(base64 "${DIRECTORY}/apps/${app5}/icon-64.png" -w 0)_g ; \ + s_IMAGE5_$(base64 "${DIRECTORY}/apps/${app6}/icon-64.png" -w 0)_g ; \ + s_IMAGE6_$(base64 "${DIRECTORY}/apps/${app7}/icon-64.png" -w 0)_g ; \ + s_IMAGE7_$(base64 "${DIRECTORY}/apps/${app8}/icon-64.png" -w 0)_g ; \ + s_IMAGE8_$(base64 "${DIRECTORY}/apps/${app9}/icon-64.png" -w 0)_g ; \ + s_IMAGE9_$(base64 "${DIRECTORY}/apps/${app10}/icon-64.png" -w 0)_g" "${DIRECTORY}/icons/vector/splashscreen-original.svg" > "${DIRECTORY}/icons/vector/splashscreen.svg" + + rsvg-convert "${DIRECTORY}/icons/vector/splashscreen.svg" > "${DIRECTORY}/icons/splashscreen.png" || rm -rf "${DIRECTORY}/icons/splashscreen.png" + +} #end of output functions add_english() { #add en_US locale for more accurate error diff --git a/icons/vector/splashscreen-original.svg b/icons/vector/splashscreen-original.svg new file mode 100644 index 0000000000..590a9dae79 --- /dev/null +++ b/icons/vector/splashscreen-original.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + circles + + + + + + + + + + + + + images + + + + + + + + + + + + + + dividers + + + + + + + + + + + logo + + + + + Loading... + \ No newline at end of file