From 02cd8edcfa41fe7aea9e61976c0fbf91e06f9bfd Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 26 Sep 2022 18:56:11 -0400 Subject: [PATCH 1/5] Revert removal of es_settings --- .../ui/emulationstation/sources/es_settings | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 packages/ui/emulationstation/sources/es_settings diff --git a/packages/ui/emulationstation/sources/es_settings b/packages/ui/emulationstation/sources/es_settings new file mode 100755 index 000000000..d5019b239 --- /dev/null +++ b/packages/ui/emulationstation/sources/es_settings @@ -0,0 +1,43 @@ +#!/bin/sh + +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2019-present Shanti Gilbert (https://github.com/shantigilbert) +# Copyright (C) 2020-present Fewtarius + +# Source predefined functions and variables +. /etc/profile + +set_audio alsa +export SDL_AUDIODRIVER=alsa + +TZ=$(get_setting system.timezone) +echo -n "TIMEZONE=${TZ}" > /storage/.cache/timezone +echo -n "${TZ}" >/storage/.cache/system_timezone +systemctl restart tz-data.service + +# create charmap used for translations +locale=$(get_setting system.language) +if [ $? == "0" ] +then + charmap="UTF-8" + lang="${locale}.${charmap}" + locpath="/storage/.config/emulationstation/locale" + i18npath="$locpath/i18n" + localepath="$locpath/$lang" + + if [ ! -d $localepath ]; then + export I18NPATH=$i18npath + performance + /usr/bin/localedef -f $charmap -i $locale $localepath + ${DEVICE_CPU_GOVERNOR} + fi + + export LOCPATH=$locpath + export LANG=$lang + export LANGUAGE=$lang + systemctl import-environment LANG + systemctl import-environment LOCPATH + systemctl import-environment I18NPATH + systemctl import-environment LANGUAGE +fi + From e491135fb3cc716ce6eadd0daf55c7d303f63d80 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 26 Sep 2022 19:09:20 -0400 Subject: [PATCH 2/5] Re-apply es_settings to emustation.service. --- packages/ui/emulationstation/system.d/emustation.service | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/ui/emulationstation/system.d/emustation.service b/packages/ui/emulationstation/system.d/emustation.service index 08a68f1a6..d9c14f369 100644 --- a/packages/ui/emulationstation/system.d/emustation.service +++ b/packages/ui/emulationstation/system.d/emustation.service @@ -5,6 +5,7 @@ ConditionPathExists=/var/lock/start.games [Service] Environment=HOME=/storage Environment=SDL_AUDIODRIVER=alsa +ExecStartPre=/usr/bin/es_settings ExecStart=/usr/bin/start_es.sh KillMode=process TimeoutStopSec=3 From e988eaae95d2f50e1c02afa34b32a83e2bff6b28 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 26 Sep 2022 19:11:53 -0400 Subject: [PATCH 3/5] Add es_settings back to the package. --- packages/ui/emulationstation/package.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/ui/emulationstation/package.mk b/packages/ui/emulationstation/package.mk index fcfc086c8..05b38dd0f 100644 --- a/packages/ui/emulationstation/package.mk +++ b/packages/ui/emulationstation/package.mk @@ -90,6 +90,9 @@ makeinstall_target() { rm -rf ${INSTALL}/usr/config/emulationstation/resources/logo.png mkdir -p ${INSTALL}/usr/bin + cp ${PKG_BUILD}/es_settings ${INSTALL}/usr/bin + chmod 0755 ${INSTALL}/usr/bin/es_settings + cp ${PKG_BUILD}/start_es.sh ${INSTALL}/usr/bin chmod 0755 ${INSTALL}/usr/bin/start_es.sh From 6fd4dc54b3f9e18dd47620ad51cbde3c3602f5c6 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 26 Sep 2022 19:57:35 -0400 Subject: [PATCH 4/5] Complete reverting ES service. --- packages/ui/emulationstation/system.d/emustation.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/emulationstation/system.d/emustation.service b/packages/ui/emulationstation/system.d/emustation.service index d9c14f369..5eec79b08 100644 --- a/packages/ui/emulationstation/system.d/emustation.service +++ b/packages/ui/emulationstation/system.d/emustation.service @@ -6,7 +6,7 @@ ConditionPathExists=/var/lock/start.games Environment=HOME=/storage Environment=SDL_AUDIODRIVER=alsa ExecStartPre=/usr/bin/es_settings -ExecStart=/usr/bin/start_es.sh +ExecStart=/usr/bin/emulationstation --log-path /var/log KillMode=process TimeoutStopSec=3 Restart=always From 9712ee03f70cff4725b1bf2d7296c7bbe8fd3141 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 26 Sep 2022 20:07:44 -0400 Subject: [PATCH 5/5] Always apply language settings if a language is defined. --- packages/ui/emulationstation/sources/es_settings | 2 +- packages/ui/emulationstation/sources/start_es.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/emulationstation/sources/es_settings b/packages/ui/emulationstation/sources/es_settings index d5019b239..1c651a82c 100755 --- a/packages/ui/emulationstation/sources/es_settings +++ b/packages/ui/emulationstation/sources/es_settings @@ -17,7 +17,7 @@ systemctl restart tz-data.service # create charmap used for translations locale=$(get_setting system.language) -if [ $? == "0" ] +if [[ -n "${locale}" ]] then charmap="UTF-8" lang="${locale}.${charmap}" diff --git a/packages/ui/emulationstation/sources/start_es.sh b/packages/ui/emulationstation/sources/start_es.sh index 3c2d90197..05da881fc 100755 --- a/packages/ui/emulationstation/sources/start_es.sh +++ b/packages/ui/emulationstation/sources/start_es.sh @@ -16,7 +16,7 @@ systemctl restart tz-data.service # create charmap used for translations locale=$(get_setting system.language) -if [ $? == "0" ] +if [[ -n "${locale}" ]] then charmap="UTF-8" lang="${locale}.${charmap}"