mirror of
https://github.com/RetroPie/RetroPie-Setup.git
synced 2024-05-20 05:10:53 -04:00
Compare commits
8 commits
1bd51275d5
...
0a8a2defb9
Author | SHA1 | Date | |
---|---|---|---|
0a8a2defb9 | |||
6d458aafac | |||
a9bdf98195 | |||
2518994e6c | |||
19865c363d | |||
08f9cc69c6 | |||
0c9e4d132f | |||
2824bddb87 |
|
@ -173,7 +173,10 @@ function build_emulationstation() {
|
|||
compareVersions $gles_ver lt 2.0 && params+=(-DUSE_GLES1=On)
|
||||
else
|
||||
params+=(-DGL=On)
|
||||
# mesa specific check of OpenGL version
|
||||
local gl_ver=$(sudo -u $user glxinfo -B | grep -oP 'Max compat profile version:\s\K.*')
|
||||
# generic fallback check of OpenGL version
|
||||
[[ -z "$gl_ver" ]] && gl_ver=$(sudo -u $user glxinfo -B | grep -oP "OpenGL version string: \K[^ ]+")
|
||||
compareVersions $gl_ver gt 2.0 && params+=(-DUSE_GL21=On)
|
||||
fi
|
||||
elif isPlatform "gles"; then
|
||||
|
@ -259,6 +262,15 @@ fi
|
|||
TTY=\$(tty)
|
||||
export TTY="\${TTY:8:1}"
|
||||
|
||||
# exit vlc before launching on kms or ES won't be able to open the display (not required on legacy drivers or fkms)
|
||||
if [[ -d /sys/module/vc4 ]] && grep -q "okay" /proc/device-tree/soc/hvs@7e400000/status 2>/dev/null; then
|
||||
vlc_pid="/tmp/vlc.pid"
|
||||
if [[ -f "\$vlc_pid" ]]; then
|
||||
kill \$(<\$vlc_pid)
|
||||
rm "\$vlc_pid"
|
||||
fi
|
||||
fi
|
||||
|
||||
clear
|
||||
tput civis
|
||||
"$md_inst/emulationstation.sh" "\$@"
|
||||
|
|
|
@ -32,9 +32,7 @@ function _video_exts_splashscreen() {
|
|||
}
|
||||
|
||||
function depends_splashscreen() {
|
||||
local params=(insserv)
|
||||
isPlatform "32bit" && params+=(omxplayer)
|
||||
getDepends "${params[@]}"
|
||||
getDepends vlc
|
||||
}
|
||||
|
||||
function install_bin_splashscreen() {
|
||||
|
@ -48,6 +46,7 @@ ConditionPathExists=$md_inst/asplashscreen.sh
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=$user
|
||||
ExecStart=$md_inst/asplashscreen.sh
|
||||
RemainAfterExit=yes
|
||||
|
||||
|
@ -55,8 +54,6 @@ RemainAfterExit=yes
|
|||
WantedBy=sysinit.target
|
||||
_EOF_
|
||||
|
||||
rp_installModule "omxiv" "_autoupdate_"
|
||||
|
||||
gitPullOrClone "$md_inst"
|
||||
|
||||
cp "$md_data/asplashscreen.sh" "$md_inst"
|
||||
|
@ -66,6 +63,9 @@ _EOF_
|
|||
iniSet "DATADIR" "$datadir"
|
||||
iniSet "REGEX_IMAGE" "$(_image_exts_splashscreen)"
|
||||
iniSet "REGEX_VIDEO" "$(_video_exts_splashscreen)"
|
||||
if isPlatform "videocore"; then
|
||||
iniSet "VLC_OPTS" "--mmal-layer 10001"
|
||||
fi
|
||||
|
||||
if [[ ! -f "$configdir/all/$md_id.cfg" ]]; then
|
||||
iniConfig "=" '"' "$configdir/all/$md_id.cfg"
|
||||
|
@ -107,9 +107,6 @@ function disable_splashscreen() {
|
|||
function configure_splashscreen() {
|
||||
[[ "$md_mode" == "remove" ]] && return
|
||||
|
||||
# remove legacy service
|
||||
[[ -f "/etc/init.d/asplashscreen" ]] && insserv -r asplashscreen && rm -f /etc/init.d/asplashscreen
|
||||
|
||||
disable_plymouth_splashscreen
|
||||
enable_splashscreen
|
||||
[[ ! -f /etc/splashscreen.list ]] && default_splashscreen
|
||||
|
@ -229,7 +226,7 @@ function preview_splashscreen() {
|
|||
|
||||
local path
|
||||
local file
|
||||
local omxiv="/opt/retropie/supplementary/omxiv/omxiv"
|
||||
local vlc="sudo -u $user vlc --intf dummy --quiet --play-and-exit --image-duration 6"
|
||||
while true; do
|
||||
local cmd=(dialog --backtitle "$__backtitle" --menu "Choose an option." 22 86 16)
|
||||
local choice=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
|
||||
|
@ -241,13 +238,13 @@ function preview_splashscreen() {
|
|||
1)
|
||||
file=$(choose_splashscreen "$path" "image")
|
||||
[[ -z "$file" ]] && break
|
||||
$omxiv -b "$file"
|
||||
$vlc "$file"
|
||||
;;
|
||||
2)
|
||||
file=$(mktemp)
|
||||
find "$path" -type f ! -regex ".*/\..*" ! -regex ".*LICENSE" ! -regex ".*README.*" ! -regex ".*\.sh" | sort > "$file"
|
||||
if [[ -s "$file" ]]; then
|
||||
$omxiv -t 6 -T blend -b --once -f "$file"
|
||||
tr "\n" "\0" <"$file" | xargs -0 $vlc
|
||||
else
|
||||
printMsgs "dialog" "There are no splashscreens installed in $path"
|
||||
fi
|
||||
|
@ -257,7 +254,7 @@ function preview_splashscreen() {
|
|||
3)
|
||||
file=$(choose_splashscreen "$path" "video")
|
||||
[[ -z "$file" ]] && break
|
||||
omxplayer --no-osd -b --layer 10000 "$file"
|
||||
$vlc "$file"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
@ -270,10 +267,6 @@ function download_extra_splashscreen() {
|
|||
}
|
||||
|
||||
function gui_splashscreen() {
|
||||
if [[ ! -d "$md_inst" ]]; then
|
||||
rp_callModule splashscreen depends
|
||||
rp_callModule splashscreen install
|
||||
fi
|
||||
local cmd=(dialog --backtitle "$__backtitle" --menu "Choose an option." 22 86 16)
|
||||
while true; do
|
||||
local enabled=0
|
||||
|
|
|
@ -4,27 +4,17 @@ ROOTDIR=""
|
|||
DATADIR=""
|
||||
REGEX_VIDEO=""
|
||||
REGEX_IMAGE=""
|
||||
VLC_OPTS=""
|
||||
|
||||
# Load user settings
|
||||
. /opt/retropie/configs/all/splashscreen.cfg
|
||||
|
||||
is_fkms() {
|
||||
if grep -q okay /proc/device-tree/soc/v3d@7ec00000/status 2> /dev/null || grep -q okay /proc/device-tree/soc/firmwarekms@7e600000/status 2> /dev/null ; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
do_start () {
|
||||
local config="/etc/splashscreen.list"
|
||||
local line
|
||||
local re="$REGEX_VIDEO\|$REGEX_IMAGE"
|
||||
local omxiv="/opt/retropie/supplementary/omxiv/omxiv"
|
||||
local vlc="vlc --intf dummy --quiet --no-video-title-show --play-and-exit "
|
||||
case "$RANDOMIZE" in
|
||||
disabled)
|
||||
line="$(head -1 "$config")"
|
||||
;;
|
||||
retropie)
|
||||
line="$(find "$ROOTDIR/supplementary/splashscreen" -type f | grep "$re" | shuf -n1)"
|
||||
;;
|
||||
|
@ -38,36 +28,34 @@ do_start () {
|
|||
line="$(cat "$config" | shuf -n1)"
|
||||
;;
|
||||
esac
|
||||
if $(echo "$line" | grep -q "$REGEX_VIDEO"); then
|
||||
# wait for dbus
|
||||
while ! pgrep "dbus" >/dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
omxplayer --no-osd -o both -b --layer 10001 "$line"
|
||||
elif $(echo "$line" | grep -q "$REGEX_IMAGE"); then
|
||||
if [ "$RANDOMIZE" = "disabled" ]; then
|
||||
local count=$(wc -l <"$config")
|
||||
else
|
||||
local count=1
|
||||
fi
|
||||
[ $count -eq 0 ] && count=1
|
||||
[ $count -gt 12 ] && count=12
|
||||
|
||||
# Default duration is 12 seconds, check if configured otherwise
|
||||
[ -z "$DURATION" ] && DURATION=12
|
||||
local delay=$((DURATION/count))
|
||||
if [ "$RANDOMIZE" = "disabled" ]; then
|
||||
"$omxiv" --once -t $delay -b --layer 10001 -f "$config" >/dev/null 2>&1
|
||||
else
|
||||
"$omxiv" --once -t $delay -b --layer 10001 -r "$line" >/dev/null 2>&1
|
||||
fi
|
||||
if [ "$RANDOMIZE" = "disabled" ]; then
|
||||
local count=$(wc -l <"$config")
|
||||
else
|
||||
local count=1
|
||||
fi
|
||||
|
||||
[ $count -eq 0 ] && count=1
|
||||
[ $count -gt 12 ] && count=12
|
||||
|
||||
# Default duration is 12 seconds, check if configured otherwise
|
||||
[ -z "$DURATION" ] && DURATION=12
|
||||
local delay=$((DURATION/count))
|
||||
|
||||
vlc="$vlc --image-duration $delay"
|
||||
if [ "$RANDOMIZE" = "disabled" ]; then
|
||||
tr "\n" "\0" <"$config" | xargs -0 $vlc & 2>/dev/null
|
||||
else
|
||||
$vlc "$line" & 2>/dev/null
|
||||
fi
|
||||
echo $! >/tmp/vlc.pid
|
||||
|
||||
exit 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|"")
|
||||
do_start &
|
||||
do_start
|
||||
;;
|
||||
restart|reload|force-reload)
|
||||
echo "Error: argument '$1' not supported" >&2
|
||||
|
|
Loading…
Reference in a new issue