distribution/packages/jelos/sources/autostart/common/001-setup

54 lines
1.6 KiB
Bash
Executable file

#!/bin/sh
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
### Switch the theme to system-theme if it hasn't already been done
if [ ! -L /storage/.config/emulationstation/themes/system-theme ]
then
rm -rf /storage/.config/emulationstation/themes/es-theme-art-book-next
mkdir -p /storage/.config/emulationstation/themes
ln -s /usr/share/themes/es-theme-art-book-next /storage/.config/emulationstation/themes/system-theme
sed -i 's#<string name="ThemeSet" value="es-theme-art-book-next"/>#<string name="ThemeSet" value="system-theme"/>#' /storage/.config/emulationstation/es_settings.cfg
fi
### Resume normal startup stuff.
OVERCLOCK=$(get_setting system.overclock)
if [ -z ${OVERCLOCK} ]
then
set_setting system.overclock off
fi
/usr/bin/overclock ${OVERCLOCK}
if [ -d "/storage/.config/system/configs" ]
then
EXCLUDE="--exclude=configs"
fi
rsync -a --delete ${EXCLUDE} /usr/config/system/ /storage/.config/system/
rsync -a /usr/config/modules /storage/.config/
rsync -a /usr/config/game /storage/.config/
rsync -a --delete /usr/config/locale/ /storage/.config/emulationstation/locale/
cp -f /usr/config/SDL-GameControllerDB/gamecontrollerdb.txt /storage/.config/SDL-GameControllerDB/gamecontrollerdb.txt
cp -f /usr/config/ppsspp/PSP/SYSTEM/controls.ini /storage/.config/ppsspp/PSP/SYSTEM/controls.ini
if [ ! -L "/storage/.emulationstation" ]
then
ln -sf /storage/.config/emulationstation /storage/.emulationstation
fi
if [ -d "/storage/cache/.cores" ]
then
rm -rf /storage/cache/.cores
fi
if [ ! -d "/tmp/cache" ]
then
mkdir /tmp/cache
fi
ln -sf /tmp/cache /storage/cache/.cores