2023-08-07 00:30:11 +00:00
|
|
|
#!/bin/sh
|
2023-10-23 22:44:47 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2023-10-24 16:00:57 +00:00
|
|
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2023-08-07 00:30:11 +00:00
|
|
|
# Minimal OS variable loading for performance
|
2023-09-04 10:46:11 +00:00
|
|
|
. /etc/profile.d/001-functions
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2023-07-22 23:56:23 +00:00
|
|
|
tocon "Configuring display..."
|
2023-04-22 20:01:07 +00:00
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
### Variables may need to be device specific here.
|
|
|
|
BRIGHTNESS=$(get_setting system.brightness)
|
2023-08-05 18:21:23 +00:00
|
|
|
if [[ -z ${BRIGHTNESS} ]]
|
2022-02-05 14:23:32 +00:00
|
|
|
then
|
2023-08-05 18:21:23 +00:00
|
|
|
BRIGHTNESS="6"
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Ensure user doesn't get "locked out" with super low brightness
|
2023-08-05 18:21:23 +00:00
|
|
|
if [[ "${BRIGHTNESS}" = "0" ]]
|
2022-02-05 14:23:32 +00:00
|
|
|
then
|
2023-08-05 18:21:23 +00:00
|
|
|
BRIGHTNESS=1
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
2022-09-05 10:58:27 +00:00
|
|
|
|
2023-08-05 18:21:23 +00:00
|
|
|
brightness set ${BRIGHTNESS}
|
2023-04-01 00:20:39 +00:00
|
|
|
|
2023-07-22 23:56:23 +00:00
|
|
|
### Set the aspect ratio in ES.
|
|
|
|
ASPECT=$(get_aspect_ratio)
|
|
|
|
|
|
|
|
ES_CONFIG="/storage/.config/emulationstation/es_settings.cfg"
|
|
|
|
ES_ASPECT="${ASPECT/:/-}"
|
|
|
|
if [ "$(grep subset.aspect-ratio ${ES_CONFIG})" ]
|
|
|
|
then
|
|
|
|
sed -i 's|<string name="subset.aspect-ratio".*$|<string name="subset.aspect-ratio" value="'${ES_ASPECT}'"/>|g' ${ES_CONFIG}
|
|
|
|
else
|
|
|
|
sed -i '/<\/config>/i \\t<string name="subset.aspect-ratio" value="'${ES_ASPECT}'"/>' ${ES_CONFIG}
|
|
|
|
fi
|
|
|
|
|