Skip to content

Commit

Permalink
api: add back original unmodified generate_splashscreen function
Browse files Browse the repository at this point in the history
Co-Authored-By: Botspot <[email protected]>
  • Loading branch information
theofficialgman and Botspot committed Oct 22, 2024
1 parent 249939a commit 413a028
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 0 deletions.
34 changes: 34 additions & 0 deletions api
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
89 changes: 89 additions & 0 deletions icons/vector/splashscreen-original.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 413a028

Please sign in to comment.