Merge pull request #2146 from fewtarius/dev

Reverts the reverted brightness PR and fixes no ssh when not building main if main is part of the branch name.
This commit is contained in:
fewtarius 2023-10-03 16:28:10 -04:00 committed by GitHub
commit 7946bbaf08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 9 deletions

View file

@ -81,7 +81,7 @@ EOF
### Defaults for non-main builds.
BUILD_BRANCH="$(git branch --show-current)"
if [[ ! "${BUILD_BRANCH}" =~ main ]]
if [ ! "${BUILD_BRANCH}" = "main" ]
then
sed -i "s#ssh.enabled=0#ssh.enabled=1#g" ${INSTALL}/usr/config/system/configs/system.cfg
sed -i "s#network.enabled=0#network.enabled=1#g" ${INSTALL}/usr/config/system/configs/system.cfg

View file

@ -8,10 +8,17 @@
BRIGHTNESS_DEV="$(find /sys/class/backlight/*/ -name brightness -print -quit)"
BRIGHTNESS_PATH="${BRIGHTNESS_DEV%/brightness}"
BRIGHTNESS_TABLE=($(get_setting brightness_table))
if [ -z $BRIGHTNESS_TABLE ]; then
BRIGHTNESS_TABLE="0 0.04 0.08 0.13 0.19 0.25 0.33 0.42 0.54 0.71 1"
set_setting brightness_table "$BRIGHTNESS_TABLE"
fi
NUM_STEPS=${#BRIGHTNESS_TABLE[@]}
MIN=0
MAX=$(<$(find /sys/class/backlight/*/ -name max_brightness -print -quit))
STEP="$(echo "scale=1; (${MAX} / 10)" | bc)"
compute() {
echo "${BRIGHTNESS_TABLE[$NEXT]} * $MAX" | bc -l
}
if [ ! -f "${BRIGHTNESS_DEV}" ]
then
@ -31,12 +38,16 @@ setBrightness() {
stepUp() {
CURRENT=$(get_setting system.brightness)
NEXT=$(( ${CURRENT} + 1 ))
if (( ${NEXT} > 10 ))
if (( ${NEXT} >= $NUM_STEPS ))
then
NEXT=10
NEXT=$(( $NUM_STEPS - 1 ))
fi
BRIGHTNESS=$(printf '%.0f' "$(echo "scale=1; ${STEP} * ${NEXT}" | bc)")
BRIGHTNESS=$(printf '%.0f' "$(compute)")
if (($BRIGHTNESS > $MAX ))
then
BRIGHTNESS=$MAX
fi
setBrightness ${BRIGHTNESS} ${NEXT}
}
@ -49,7 +60,7 @@ stepDown() {
NEXT=0
fi
BRIGHTNESS=$(printf '%.0f' "$(echo "scale=1; ${STEP} * ${NEXT}" | bc)")
BRIGHTNESS=$(printf '%.0f' "$(compute)")
setBrightness ${BRIGHTNESS} ${NEXT}
}
@ -68,7 +79,8 @@ case ${1} in
echo ${BRIGHTNESS_PATH}
;;
"set")
setBrightness "$(printf '%.0f' "$(echo "scale=1; ${STEP} * ${2}" | bc)")" ${2}
NEXT=${2}
setBrightness "$(printf '%.0f' "$(compute)")" ${2}
;;
*)
echo $(getBrightness)

View file

@ -3,7 +3,7 @@
# Copyright (C) 2020-present Fewtarius
PKG_NAME="emulationstation"
PKG_VERSION="345fc99"
PKG_VERSION="29db271"
PKG_GIT_CLONE_BRANCH="main"
PKG_REV="1"
PKG_ARCH="any"