Hi - For what it’s worth, while I don’t regularly use touchscreen devices, one idea could be to see if there’s a configuration file that changes in ~/.config
(or one of its subdirectories) when you toggle the desired setting in the interface.
If so, you might be able to use kwriteconfig6
as the basis for whatever toggle tool you make, similar to what was described here: Energymanagement via Console - #2 by johnandmegh
There’s probably a more elegant method using D-Bus also, so folks who are more familiar with that topic might have some better ideas there