Made a proof-of-concept hack to disable #squeekboard in #mobian and #pureos when an external keyboad gets connected.
It consists of a udev .rules file, a bash script and and application link for a "switch keyboard" app icon to toggle the setting by tapping on it.
@agx provided the information about the gsetting to use and Dorota helped me with information about the future of this function in squeekboard: https://source.puri.sm/Librem5/squeekboard/-/issues/254.
The files can be found here: https://codeberg.org/ChriChri/switch_keyboard