From 843ddf9e7df075e628f9e61d239fcbd34084d032 Mon Sep 17 00:00:00 2001 From: Tobias Mueller Date: Mon, 16 Oct 2023 12:14:00 +0200 Subject: [PATCH] switch: attempt to react to the hardware button I don't know whether this works. On the v4 firmware, we can see files in /etc/gl-switch.d but I don't know yet how the system determines which file to choose. I assume it's dependend on the "page" of the display. But I haven't figured out yet how or rather where those pages are organised. --- files/etc/gl-switch.d/sim.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 files/etc/gl-switch.d/sim.sh diff --git a/files/etc/gl-switch.d/sim.sh b/files/etc/gl-switch.d/sim.sh new file mode 100644 index 0000000..f06278f --- /dev/null +++ b/files/etc/gl-switch.d/sim.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +action=$1 + +if [ "$action" = "on" ];then + echo "on" > /tmp/sim_change_switch + +elif [ "$action" = "off" ];then + echo "off" > /tmp/sim_change_switch +else + echo "off" > /tmp/sim_change_switch +fi +sleep 1 +