A simple On/Off switch that executes a script when the switch is toggled.
It is based on the ToggleButton Widget part of Qt Quick Extra. Thus, depending on your distribution you have to ensure that the correspondign package is installed. Look out for libqt5-qtquickcontrols (openSUSE), qt5-qtquickcontrols (Fedora), or qml-module-qtquick-extras (Ubuntu).
This widget is is inspired by the corresponding Plasma 4 widget done by Roland Pabel found here: