How To Use a Different Keyboard?

I recently built wvkbd from source (https://git.sr.ht/~proycon/wvkbd), and I am curious to try it out in Phosh. But I don’t know how squeekboard is invoked. Can I change an environment variable or config file to use the wvkbd executable as my keyboard?

If I extrapolate from: https://social.librem.one/@agx/111036980219064093

$ update-alternatives --display Phosh-OSK
Phosh-OSK - auto mode
  link best version is /usr/share/applications/sm.puri.Squeekboard.desktop
  link currently points to /usr/share/applications/sm.puri.Squeekboard.desktop
  link Phosh-OSK is /usr/share/applications/sm.puri.OSK0.desktop
/usr/share/applications/sm.puri.OSK0-legacy.desktop - priority 20
/usr/share/applications/sm.puri.Squeekboard.desktop - priority 50

Then it’s probably doable to set another OSK as preferred alternative for Phosh-OSK

Hmm… in case anyone else is tempted to try this: I installed wvkbd to Phosh-OSK, but now my phone won’t boot :man_facepalming:

Oh… not even accessible via ssh? Maybe you can mount the storage from your computer and fix the symlinks?

I never enabled sshd, so I think that’s not an option.

Do you know of a guide for doing what you are saying?

Sorry that happened! I think it should still boot - maybe connecting a hardware keyboard, Ctrl+Alt+F3 allows you to login and undo your changes.

My recommendation is generally not try this without ssh enabled (so that you can log in to fix things) - or, even saver, to boot the Librem 5 from SD card (into PureOS, Mobian or postmarketOS) and experiment on that system.

I have tried using wvkbd with Phosh before on postmarketOS and it was a rather crashy experience - I never tried to debug this, so fixing the crashes might be easy.

To find out what to do, here’s what changes in /usr/share/applications/sm.puri.OSK0.desktop when changing to phosh-osk-stub (installable from the Octarine repo) via sudo update-alternatives --config Phosh-OSK:

See the diff here: https://media.linmob.net/diffs/sm.puri.OSK0.desktop.diff

Changing the exec line to the binary you want to run instead (I’d suggest launching it manually beforehand) is the most important change here and should do enough. I recommend making a copy of the file before changing it so that you can easily go back to using Squeekboard.

Good luck!

Don’t know whether it does exactly what is being suggested but: [Guide] How to investigate and fix a Librem 5 installation that hangs at boot

sm.puri.OSK is a required session component you can’t put another program there that doesn’t adhere to those interfaces:

The OSK needs to

  • register to the session manager
  • provide the sm.puri.OSK0 DBus service

Changing the sm.puri.OSK0.desktop file (or using update-alternatives) will give you a crashing session until you implement the above interfaces). This is because you claim to be compatible with sm.puri.OSK0 but you aren’t.

You can get ideas how to add that (it’s not much code from squeekboard and phosh-osk-stub).

If you don’t want to code anything you can remove sm.puri.phosh.OS0 from the /usr/share/gnome-session/sessions/phosh.session and the session will run without an OSK. You need to make sure to start wvkb via other means then (e.g. via xdg-autostart).

To recover you can use an USB keyboard or use a usb-c to usb-a cable to your laptop to get a console.

3 Likes

@weirdnerd I created ~earboxer/osk0-wvkbd-wrapper - WIP wrapper for wvkbd on phosh - sourcehut git for this purpose

As Guido says, it provides the sm.puri.OSK0 service, and reacts to the open/close events. Unfortunately, it doesn’t respond to those events, so once the keyboard is opened, clicking the keyboard button again won’t close it. (so to close the keyboard, you have to use the power-button).

Hopefully this will provide a decent starting-place for the next person to implement this correctly.

1 Like

Alas, I tried your package, but it also seems to crash Phosh for me.

I was able to recover my installation with this method. The adventures go on! :slight_smile:

1 Like