I would like to be able to toggle the setting “Disable while typing” on and off with a keyboard shortcut. So far I’ve found that using kwriteconfig5 I can edit the config file for kcminputrc, and while the changes are reflected in the file they don’t seem to take effect until I logout.
I was hoping to be able to use this command to toggle it on and off with the press of a button, however I can’t figure out how to get it to take effect without logging out. Its obviously possible to change the settings since they can be changed from the system settings GUI after pressing the apply button. So if anyone knows of some way to either have these changes immediately recognized, or even some other way of accomplishing the same goal I’d love to know!
In case anyone else is looking to do something similar, the best solution I have found so far is kwin_wayland --replace which takes only a couple seconds to apply. It is described as
Exits this instance so it can be restarted by kwin_wayland_wrapper.
You may need to have session restore enabled in order for this to work without closing any applications you have open, I haven’t tested this for myself.
If anyone has an idea for a better way to do this I’m all ears!
If you want to change the setting of all connected touchpads:
for i in $(grep touchpad /sys/class/input/event*/device/name -li); do
e=$(echo $i | cut -d/ -f5)
qdbus org.kde.kglobalaccel /org/kde/KWin/InputDevice/$e org.freedesktop.DBus.Properties.Set org.kde.KWin.InputDevice disableWhileTyping false
done
Note that the change of the dbus property is immediately effective and persisted into ~/.config/kcminputrc, i.e. DisableWhileTyping= entries are created/updated there.
However, if you have the Hardware Input Devices Touchpad KDE Settings dialog open while changing that dbus property, the corresponding checkbox is NOT immediately updated in that UI.
You can work around this by switching to another input device in the settings UI and when switching back to the Touchpad panel you see the update.