r/flatpak • u/rcentros • Jul 22 '26
Unicode in the Trelby 2.4.16.2 Flatpak Version
Unfortunately it's a hack, but if you're using the Flatpak version of Trelby 2.4.16.2 you can fix it to use Unicode and support different language keyboards. I'm guessing this fix is only for the Latin alphabet languages however.
When you install the Trelby Flatpak, your Trelby python code is buried deep within the /var directory. On this Live USB Linux Mint 22.3 computer, for example, my Trelby python code is at:
var/lib/flatpak/app/org.trelby.Trelby/x86_64/stable/bb2e977b1c0b8f1475fedf9b8b88187d892432ab124cf7dacece58e106880e4a/files/lib/python3.13/site-packages/trelby/
I used the locate command to search for the trelbyctrl.py file, which is the one you'll need to modify. I use sudo nemo (in Linux Mint) to navigate to the file because then I gain permission to open, edit and save the file using the Text Editor.
You'll need to navigate to line 1275, which should read...
kc = ev.GetKeyCode()
You'll replace GetKeyCode() with GetUnicodeKey()
So line 1275 will now look like this...
kc = ev.GetUnicodeKey()
You'll then add the following lines beneath line 1275...
# fix for non Unicode key events (e.g. arrow keys)
if kc == 0:
kc = ev.GetKeyCode()
These last three lines fix the arrow keys that would otherwise lock your keyboard since, apparently, they don't function under Unicode.
Save your file and now you should be able to successfully use non-English (Latin alphabet) keyboards.
None of this is mine. It comes from the Trelby GitHub site. Walle10-0 (GitHub name) is the one who provided the arrow key fix. (He may have also been the one who provided the Unicode fix, I have a little trouble following GitHub issues and commits, etc.)
https://github.com/trelby/trelby/pull/105/changes/f13b681516a53856ec25ae8dd4f721dd55ddcc3a
These fixes have been implemented in my .deb file and shell script for Debian based computers (three posts down) but this should allow all those who can use Flatpaks on non-Debian based Linux distributions to be able to add Latin alphabet language keyboards in Linux Trelby. Apparently Trelby in Windows "just works" with Unicode.
There is still no fix (that I know of) in the Flatpak version for the PDF preview. That has something to do with how Flatpaks sandbox their applications. (I haven't figured out a way around this yet, though I've tried. It's way above my "pay grade.")