give r+w permission to any user on offset reduce brightness to less 1

This commit is contained in:
Theluga 2023-12-16 13:48:27 +00:00 committed by GitHub
parent a1107f5433
commit 9f69672f64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,6 +64,7 @@ if [[ -f /tmp/AB.offset ]]; then
else else
OffSet=0 OffSet=0
echo $OffSet > /tmp/AB.offset echo $OffSet > /tmp/AB.offset
chmod 666 /tmp/AB.offset
fi fi
OffSet=$((OffSet < 0 ? 0 : OffSet)) OffSet=$((OffSet < 0 ? 0 : OffSet))
@ -77,6 +78,7 @@ if [[ $op -lt 2 ]]; then
OffSet=$((OffSet < 0 ? 0 : OffSet)) OffSet=$((OffSet < 0 ? 0 : OffSet))
echo $OffSet > /tmp/AB.offset echo $OffSet > /tmp/AB.offset
chmod 666 /tmp/AB.offset
exit exit
fi fi
@ -101,6 +103,7 @@ until [ -f /tmp/AB.kill ]; do
else else
OffSet=0 OffSet=0
echo $OffSet > /tmp/AB.offset echo $OffSet > /tmp/AB.offset
chmod 666 /tmp/AB.offset
fi fi
Light=$(cat /sys/bus/iio/devices/iio:device5/in_illuminance_raw) Light=$(cat /sys/bus/iio/devices/iio:device5/in_illuminance_raw)
@ -144,7 +147,7 @@ until [ -f /tmp/AB.kill ]; do
OldLight=$Light OldLight=$Light
fi fi
if [[ $Light -lt 3 ]]; then if [[ $Light -lt 1 ]]; then
smoothly_increase_brightness smoothly_increase_brightness
fi fi