New Post: Opportunistic Word Completion

There’s a shortcut bar where you can put common shortcuts. See the manpage (man phosh-osk-stub or here) on how to configure them.

With recent GTK4 and phoc you can also rearrange them via d’n’d: Guido Günther: "It's the small things. @rudraps@mastodon.social i…" - Librem Social (not in crimson yet as it needs newer phoc and and gtk4).

7 Likes

Do I see right that those shortcuts can be build by users? I’m asking because we still have no access to Shift-shortcuts (that does not depend on upper characters - like Shift+arrows).

1 Like

Yes, although reading the provided documentation does not clarify possible valid strings.

Here is a screenshot of executing the above code.

Here is a quick modification of that example code, along with the corresponding screenshot.

gsettings set sm.puri.phosh.osk.Terminal shortcuts "['<ctrl>a', '<ctrl>z', '<ctrl>x', '<ctrl>c', '<ctrl>v']"

3 Likes

Shouldn’t be a problem:

gsettings set sm.puri.phosh.osk.Terminal shortcuts "['<shift>Up', …]"

Note that you need at leat phosh-osk-stub 0.33.0 (crimson, byzantium-updates-propoed) as otherwise it’ll crash due to a GTK bug (which is fixed but not yet in PureOS) and for which the aforementioned versions have a workaround: Details: vk-driver: Don't crash when gdk keysm conversion fails (!107) · Merge requests · Guido Günther / phosh-osk-stub · GitLab

Updates to the manpage are certainly welcome.

3 Likes

Works as expected.

3 Likes

Thank you for the screenshot! Looks like that bar is missing for me :thinking:

2 Likes

If you are on Byzantium, you need to add byzantium-updates-proposed to your /etc/apt/sources.list:

sudo nano /etc/apt/sources.list

Once opened, add this line:

deb https://repo.pureos.net/pureos byzantium-updates-proposed main

Then:

sudo apt update
sudo apt install phosh-osk-stub

If you already installed the package, use sudo apt upgrade phosh-osk-stub for the second command instead.


Here are the possible valid strings for the keyboard shortcuts:

So, as an example:

gsettings set sm.puri.phosh.osk.Terminal shortcuts "['Mail', 'Calculator', 'Documents', 'Tools']"

This allows you to conveniently launch Geary, Calculator, GNOME Files/Nautilus, and Settings, respectively. Note that not all values from the list are properly mapped to a function at this time.

4 Likes

Thanks! Now it works, and emojis in fractal works as well :grin:

2 Likes

Just a word of caution: enabling byzantium-updates-proposed gets you less tested software (including kernels). So I’d either enable apt pinning (to only selectively pull packages from there (Document apt pinning configuration (#173) · Issues · Librem5 / developer.puri.sm · GitLab)) or remove it after fetching the package.

5 Likes

After some intense experimentations, I have a few terminal shortcut configurations I like. This one is used for documents:

gsettings set sm.puri.phosh.osk.Terminal shortcuts "['Cut', 'Copy', 'Paste', 'Undo', 'Redo']"

This one is an application launcher based on the prior post I made above:

gsettings set sm.puri.phosh.osk.Terminal shortcuts "['WWW', 'Mail', 'Calculator', 'Explorer']"

If you want to combine them, along with “Tools” to split the shortcuts into two distinct sections:

gsettings set sm.puri.phosh.osk.Terminal shortcuts "['Cut', 'Copy', 'Paste', 'Undo', 'Redo', 'WWW', 'Mail', 'Calculator', 'Explorer', 'Tools']"

Currently, Shift, Alt, and Control cannot be created as standalone terminal shortcuts, as I suspect it has to do with them normally being toggle buttons.

5 Likes

I am a millenial if I recall according to how they classify people, but I find autocomplete text very annoying. Before moving to Librem 5, my Android had all the auto completes turned off so that it showed a keyboard, and each screen tap of a letter would put that letter on the page. I find this to be more wholesome and sensible than the alternatives.

Aren’t autocorrecting AIs often used as an excuse to collect user data?

6 Likes

Does this even matter? Who wants to collect data will do it - with “reason” or without.

1 Like

The correction is all local so who would collect that data? Also if you don’t want it, you disable it.

5 Likes

If I’m reading the topic correctly, you could use a remote AI for autocorrection (completion), but if that does not meet your privacy requirements (it certainly wouldn’t meet mine) then … you simply wouldn’t do that. You would use local completion.

In principle, that local completion could be using AI that has been trained on the internet but as long as you are running it locally, you can verify the code and be sure that it is not collecting anything or at least not sending anything to the internet. (It can make sense for it to collect local data in order to adapt the AI to your specific usage e.g. if you keep on using a surprising word sequence that few internet users have used then the AI would ideally adapt to that.)

However this (AI) goes well beyond just “checking a dictionary”, which may still be an improvement over the current behaviour.

1 Like

The option to switch it of is music to my ears :grinning:

2 Likes

It is simply a toggle in the Mobile Settings app, and currently off by default.

5 Likes

I assume you are running Crimson, since my mobile settings app is lacking any of those options.

1 Like

Yes, but that is irrelevant: phosh-osk-stub is required to enable any of these options.

3 Likes

OK, that explains it. Thanks for the info.

2 Likes

This is what I’m using for shortcuts:

gsettings set sm.puri.phosh.osk.Terminal shortcuts "['<ctrl>a', '<ctrl>x', '<ctrl>c', '<ctrl>v', 'Up', 'Down', 'Left', 'Right', '<ctrl>q', '<ctrl>w', '<ctrl>r', '<ctrl>z', '<ctrl>i', '<ctrl>o', '<ctrl>f', 'Delete', 'Menu']"

There are lots of Ctrl commands, as well as Delete, Menu, and all arrows (Up, Down, Left, & Right).

4 Likes