165f994bc1
* Drop deprecated device.config from AMD64. * Add a platform quirk for AMD64.x
36 lines
965 B
Bash
Executable file
36 lines
965 B
Bash
Executable file
#!/bin/sh
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
|
|
|
|
# Minimal OS variable loading for performance
|
|
. /etc/profile.d/001-functions
|
|
|
|
tocon "Configuring display..."
|
|
|
|
### Variables may need to be device specific here.
|
|
BRIGHTNESS=$(get_setting system.brightness)
|
|
if [[ -z ${BRIGHTNESS} ]]
|
|
then
|
|
BRIGHTNESS="6"
|
|
fi
|
|
|
|
# Ensure user doesn't get "locked out" with super low brightness
|
|
if [[ "${BRIGHTNESS}" = "0" ]]
|
|
then
|
|
BRIGHTNESS=1
|
|
fi
|
|
|
|
brightness set ${BRIGHTNESS}
|
|
|
|
### 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
|
|
|