This repository was archived by the owner on Apr 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +52
-4
lines changed
Expand file tree Collapse file tree 4 files changed +52
-4
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,28 @@ FROM balenalib/raspberrypi3-alpine
33COPY scripts /usr/src/
44RUN chmod +x /usr/src/*.sh
55
6+ RUN apk --no-cache add raspberrypi raspberrypi-libs raspberrypi-dev alpine-sdk \
7+ eudev-dev python3-dev libxrandr-dev swig \
8+ p8-platform-dev cmake && \
9+ adduser -S builder -G abuild
10+
11+ USER builder
12+
13+ RUN cd && \
14+ wget https://git.alpinelinux.org/aports/plain/community/libcec/APKBUILD && \
15+ sed -i \
16+ -e '23a-DRPI_INCLUDE_DIR=/opt/vc/include \\ ' \
17+ -e '23a-DRPI_LIB_DIR=/opt/vc/lib \\ ' \
18+ APKBUILD && \
19+ abuild-keygen -a -i && \
20+ abuild
21+
22+ USER root
23+
24+ RUN apk --allow-untrusted --no-cache add \
25+ /home/builder/packages/home/*/libcec-4*.apk && \
26+ deluser --remove-home builder && \
27+ apk del raspberrypi-dev alpine-sdk eudev-dev python3-dev libxrandr-dev \
28+ swig p8-platform-dev cmake
29+
630CMD /usr/src/start.sh
Original file line number Diff line number Diff line change 11#! /bin/bash
2- echo -n 1 > /sys/class/backlight/rpi_backlight/bl_power
2+
3+ export PATH=" $PATH :/opt/vc/bin/"
4+ export LD_LIBRARY_PATH=" /opt/vc/lib/"
5+
6+ output=$( tvservice -s)
7+
8+ if [[ $output =~ " 0x400000 [LCD]" ]]; then
9+ echo -n 1 > /sys/class/backlight/rpi_backlight/bl_power
10+ else
11+ echo standby 0 | cec-client -d 1 -s
12+ fi
Original file line number Diff line number Diff line change 11#! /bin/bash
2- echo -n 0 > /sys/class/backlight/rpi_backlight/bl_power
2+
3+ export PATH=" $PATH :/opt/vc/bin/"
4+ export LD_LIBRARY_PATH=" /opt/vc/lib/"
5+
6+ output=$( tvservice -s)
7+
8+ if [[ $output =~ " 0x400000 [LCD]" ]]; then
9+ echo -n 0 > /sys/class/backlight/rpi_backlight/bl_power
10+ else
11+ echo as 0 | cec-client -d 1 -s
12+ fi
Original file line number Diff line number Diff line change 11#! /bin/bash
2+
23if [ ! -z ${ENABLE_BACKLIGHT_TIMER+x} ] && [ " $ENABLE_BACKLIGHT_TIMER " -eq " 1" ]
34then
4- (crontab -l; echo " ${BACKLIGHT_ON:- 0 8 * * * } /usr/src/backlight_on.sh" ) | crontab -
5- (crontab -l; echo " ${BACKLIGHT_OFF:- 0 23 * * * } /usr/src/backlight_off.sh" ) | crontab -
5+ (
6+ crontab -l
7+ echo " ${BACKLIGHT_ON:- 0 8 * * * } /usr/src/backlight_on.sh"
8+ echo " ${BACKLIGHT_OFF:- 0 23 * * * } /usr/src/backlight_off.sh"
9+ ) | crontab -
610fi
711
812crond -f
You can’t perform that action at this time.
0 commit comments