6

I recently got a laptop with a touchscreen, and I'm running Ubuntu 19.10. The on-screen keyboard comes up when I focus a textbox with the touchscreen, and I usually don't want it to. However, this laptop (a Lenovo Yoga) can be folded back to turn into a tablet, and in those cases I do want the OSK's auto-show behavior.

I'd like to write a script to toggle the auto-show behavior on and off. The Block Caribou GNOME extension comes up a lot in these discussions, but it doesn't fit my use-case because it's not something I can turn on and off from a script (and even if I could it's a bit rube-goldbergy).

Is there some sort of command I can run to toggle the auto-show behavior? Note that I don't want a command that shows/hides the OSK, I want to enable/disable the auto-show behavior.

Jack M
  • 1,648
  • 3
  • 21
  • 36

1 Answers1

1

Well, you can look into the source code of block caribou to see how it actually blocks it and block in the same way from your script :) https://github.com/keringar/cariboublocker

I think the easiest one-line solution would be to try to disable/enable the block caribou extension from your script.

$ gnome-extensions list
$ gnome-extensions enable cariboublocker@git.keringar.xyz
$ gnome-extensions disable cariboublocker@git.keringar.xyz

edit: I actually really like your idea of running commands when switching between tablet and desktop mode and I felt someone should have implemented that already. I found https://github.com/alesguzik/linux_detect_tablet_mode that might help in running those commands.

lost
  • 44
  • 5