Adjusting keyboard lay-outs in Sailfish 3

Adjusting keyboard lay-out in Sailfish 3

Jolla and their mobile operating system Sailfish X (now on version 3.0.1.14, Sipoonkorpi) is a very interesting operating system. Although it is not 100% open source, it is European and more privacy-oriented than the two other big contenders: iOS and Android.

Lately I have been running the various Sailfish 3 versions on my Sony XA2. I think that on the whole it’s certainly not a ‘daily driver’ (at least for my use case) but it is getting better.

When the beta came out that had predictive text input and Alien Dalvik (for Android Emulation), as well as MS Exchange support (for which I obviously have no use) came out, I bought it immediately for the introductory offer of € 29.90.

So far so good, and I enjoy having a few select Android apps on my Sailfish phone. It’s amazing how much the HP 12c (or an emulator) grows on you, and Teletext still is a very relevant way to get the latest news. It’s also good to install the Opera Internet browser as the built-in browser is of little use. A community wiki on what runs and what not can be found here, additions are made all the time.

Interaction

Despite SailfishOS being very swipe-oriented, the real content and interaction on the phone is still by a keyboard. Although there are two devices (the Gemini and the Cosmo Communicator) that have actual, physical, keyboards and remind us of the Psion 5mx, on an XA2 most interaction is going to be with an on-screen keyboard.

Gemini running Sailfish

XA2 running Sailfish

With the text prediction turned on, I found out that the on-screen keyboard follows the language of the text prediction. As I often write messages in Dutch, English and German in parallel, German was problematic. It uses the QWERTZ-layout rather than the QWERTY I prefer to use. It’s annoying to have two keys switched around and to have unnecessary keys (ö, ä, ü) take up screen space.

Overview - and no, I haven’t tried ‘Emoji’ yet ;)

On Android, Microsoft’s SwiftKey is my preferred keyboard, letting me use many different languages without selection and also letting me select the keyboard layout that I want.

SwiftKey menu

Hardware keyboards - X11 structure

On trawling together.jolla.com, the main place for interaction between users and Jolla, I found this issue of a user who had issues with his Russian keyboard.

From there, I also learned that the lay-outs are in /usr/share/X11/xkb/symbols, with some versions adding extra directories for specific use cases. The layouts have a two-letter name, with the name saying the language they are for (i.e. de for German, nl for Dutch).

For me, the US International version of keyboard used for Dutch and English is very sensible (and more sensible than that on most Linux distributions). It has c-cedilla (ç) and n-tilde (ñ), and not characters like ć or ń that are used in Slavic languages (which are not relevant to me).

My initial thought was that copying de to de.original to have a backup, and then a simple

cp us de

would solve the issue, i.e. replacing the layout that I don’t like with the one I want I want. Unfortunately, that turned out not to be the case, also not after a full reboot.

From a Telegram group called Sailfish OS Fan Club (their link to join changes from time to time, so I won’t link it, but you can find it on the web) I learnt that the X11 layouts are not used for on-screen keyboards.

Virtual keyboards

Further searching revealed this Wiki on virtual keyboards. Even though it was written for SailfishOS 1 and last updated in 2016 (although of course, I could update it myself), the infrastructure described in this article remains in place.

This means that the layouts for on-screen keyboards are are stored in /usr/share/maliit/plugins/com/jolla/layouts/ and can be changed. For that you need superuser privileges, and a suitable editor. The Wiki mentioned previously also holds plenty background information on doing this. In my case, no major major adjustments are necessary, because I just want to replace one lay-out with another.

So it was quickly SSH-ing into my XA2, change to developer mode (see here how to enable it), become root (superuser) by executing su-devel and then simply do this:

cd /usr/share/maliit/plugins/com/jolla/layouts/
cp de.qml de.qml.original
cp en.qml de.qml

Then it was another reboot, I switched to the ‘Notes’ application immediately and saw this great keyboard lay-out.

QWERTY lay-out, German text prediction

Another niggle solved, another step for SailfishOS in becoming a more relevant mobile OS.

Sailfish OS Updates

With updates to newer Sailfish OS versions, this tweak does not always survive. In that case, just repeat the process described in this article. You can safely overwrite any previous versions of de.qml.original (or any other language) if you want.

Update August 2019

This tweak is still working on the latest Sailfish OS 3.1 - build 3.1.0.11 (Seitseminen).

From time to time I document my findings as a Sailfish user. If you want to find more articles on Sailfish, then please follow this link.

Avatar
Wian Stienstra
ICT, Strategy, Marketing and More
comments powered by Disqus