2022-02-05 14:23:32 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# Copyright (C) 2019-present SumavisionQ5 (https://github.com/SumavisionQ5)
|
|
|
|
# Modifications by Shanti Gilbert (https://github.com/shantigilbert)
|
|
|
|
# Copyright (C) 2020-present Fewtarius
|
|
|
|
|
|
|
|
. /etc/profile
|
|
|
|
|
|
|
|
SPLASH_TYPE="$1"
|
|
|
|
|
2022-12-19 22:14:32 +00:00
|
|
|
rotation="$(cat /sys/devices/virtual/graphics/fbcon/rotate)"
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-05-27 22:33:28 +00:00
|
|
|
if [ "${SPLASH_TYPE}" == "intro" ] || [ "${SPLASH_TYPE}" == "exit" ]
|
2022-02-05 14:23:32 +00:00
|
|
|
then
|
2022-12-20 11:48:00 +00:00
|
|
|
case ${rotation} in
|
|
|
|
0)
|
|
|
|
SPLASH="/usr/config/splash/splash.png"
|
|
|
|
;;
|
|
|
|
1)
|
|
|
|
SPLASH="/usr/config/splash/splash_90.png"
|
|
|
|
;;
|
|
|
|
2)
|
|
|
|
SPLASH="/usr/config/splash/splash_180.png"
|
|
|
|
;;
|
|
|
|
3)
|
|
|
|
SPLASH="/usr/config/splash/splash_270.png"
|
|
|
|
;;
|
|
|
|
esac
|
2022-05-27 22:33:28 +00:00
|
|
|
else
|
|
|
|
exit 0
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
[[ "${PLATFORM}" != "intro" ]] && VIDEO=0 || VIDEO=$(get_setting bootvideo.enabled)
|
|
|
|
|
2022-02-27 02:40:30 +00:00
|
|
|
if [[ -f "/storage/.config/system/configs/novideo" ]] && [[ ${VIDEO} != "1" ]]
|
2022-02-05 14:23:32 +00:00
|
|
|
then
|
2022-03-28 21:12:31 +00:00
|
|
|
if [ "${SPLASH_LOADER}" = "plymouth" ] || [ -z "${SPLASH_LOADER}" ]
|
|
|
|
then
|
|
|
|
ply-image "${SPLASH}" 2>/dev/null
|
|
|
|
elif [ "${SPLASH_LOADER}" = "imagemagick" ]
|
|
|
|
then
|
|
|
|
convert "${SPLASH}" -background black -gravity center bgra:/dev/fb0 > /dev/null 2>&1
|
|
|
|
fi
|
2022-02-05 14:23:32 +00:00
|
|
|
else
|
|
|
|
# Show intro video
|
|
|
|
SPLASH=${VIDEOSPLASH}
|
|
|
|
set_audio alsa
|
2022-05-27 22:33:28 +00:00
|
|
|
/usr/bin/mpv "${SPLASH}" > /dev/null 2>&1
|
2022-02-27 02:40:30 +00:00
|
|
|
touch "/storage/.config/system/configs/novideo"
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
2022-02-27 02:40:30 +00:00
|
|
|
# Wait for the time specified in splash_delay setting in system.cfg
|
2022-02-05 14:23:32 +00:00
|
|
|
SPLASHTIME=$(get_setting splash.delay)
|
2022-05-27 22:33:28 +00:00
|
|
|
[ ! -z "${SPLASHTIME}" ] && sleep ${SPLASHTIME}
|