Define custom actions for left switch button on Beryl AX

Is there any way to add custom actions to a left switch button on Beryl AX? I would like to start/stop MJPG Streamer via this button.

I am not sure if it applies to the Beryl AX as well, but look up those files:

I have already seen the construction in /etc/rc.button and /gl-switch.d and I am fine with them. But I have no idea, how to define the actual actions to happen - commands here just change the state in configuration and send messages when button is switched. And in Beryl AX there is no /etc/init.d/initswitch

I don’t own a Beryl, but by looking inside the firmware file I assume that all necessary files are within \etc\gl-switch.d

You can’t really modify the GUI, so I would stay with an option like “enable Wireguard” and change the \etc\gl-switch.d\wireguard.sh so it will do what I need.

The switch itself does not know about right or left - only on and off.
Make sure to include \etc\gl-switch.d\wireguard.sh to \etc\sysupgrade.conf later so firmware updates won’t break it.