phosh-osk-stub is configured via GSettings. This includes configuration of the loaded layouts from
org.gnome.desktop.input-sources via the sources and xkb-options keys, whether the OSK is enabled at all
via the org.gnome.desktop.a11y.applications's screen-keyboard-enabled and configuration of word
completion (see below).
For the keyboard to fold and unfold automatically make sure org.gnome.desktop.interfacegtk-im-module is
set to the empty string (''). This is the default in most distributions. If unsure check via:
gsettings get org.gnome.desktop.interface gtk-im-module
WORDCOMPLETIONphosh-osk-stub has support for word completion and correction via various completers (see below). It has
several modes of operation represented by flags that can be combined:
• off: no word completion
• manual: enable and disable completion via an option in the language popover
• hint: enables and disables completion based on the text input's completion hint.
Valid settings are off, manual, hint and manual+hint. These can be enabled configured via the gsettings
command:
# off
gsettings set sm.puri.phosh.osk completion-mode "[]"
# manual
gsettings set sm.puri.phosh.osk completion-mode "['manual']"
# hint
gsettings set sm.puri.phosh.osk completion-mode "['hint']"
# manual+hint
gsettings set sm.puri.phosh.osk completion-mode "['manual','hint']"
# Reset to default (off)
gsettings reset sm.puri.phosh.osk completion-mode
Note that completion is always disabled when
• No usable completers are found on startup
• Terminal or emoji layout is in use
• The application doesn't support text-input so phosh-osk-stub is falling back virtual-keyboard mode.
AVAILABLECOMPLETERS
The available completers depend on how phosh-osk-stub was built. Available are currently at most
• hunspell: word correction based on the hunspell library
• presage: (experimental) word prediction based on the presage library
• pipe: completer using a pipe
• fzf: completer based on fzf command line tool. Useful for experiments)
• varnam: completer using govarnam for Indic languages
The default word completer is selected via the sm.puri.phosh.osk.Completersdefault GSetting.
gsettings set sm.puri.phosh.osk.Completers default hunspell
You need to restart phosh-osk-stub for the new default completer to become active.
TEXTCORRECTIONUSINGHUNSPELL
The hunspell completer needs dictionaries and affix files in /usr/share/hunspell`.Mostimportantly``/usr/share/hunspell/en_US.dic and /usr/share/hunspell/en_US.aff are required as fallback when no
matching dictionary for the current layout is found.
TEXTCOMPLETIONUSINGPRESAGE
The presage based completer is considered experimental as there are some known issues when interacting
with GTK4 applications.
For the presage based completer to work you need a model file in /usr/share/phosh/osk/presage/. Likely
your distribution already ships one with the presage library. You can simply symlink it there. Models
for more languages can be found in
<https://gitlab.gnome.org/guidog/phosh-osk-data>
TEXTCOMPLETIONUSINGPIPE
This completer feeds the current input word (preedit) to an executable file and expects the executable to
output possible completions on stdout. The executable to invoke is configured via the
sm.puri.phosh.osk.Completers.Pipecommand GSetting. It defaults to cat. This can be used to experiment
with different completion patterns without having to modify phosh-osk-stub itself.
gsettings set sm.puri.phosh.osk.Completers.Pipe command 'wc -c'
You need to restart phosh-osk-stub for the new command to become active. A commonly used executable is
swipeGuess: <https://git.sr.ht/~earboxer/swipeGuess>
TEXTCOMPLETIONUSINGVARNAM
This completer feeds the current input word (preedit) to govarnam for easy input of Indic languages.
For the completer to work it needs govarnam and the language schema files installed. Please refer to the
govarnam documentation.
Note that while you can enable govarnam as default completer this is not recommended. Instead enable it
for a specific language via the sources gsettings:
gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('ibus', 'varnam:ml'), ('ibus', 'varnam:ta')]"
The above would only enable govranam for Malayalam and Tamil while the English US layout would still use
the default completer.
TERMINALSHORTCUTSphosh-osk-stub can provide a row of keyboard shortcuts on the terminal layout. These are configured via
the shortcuts GSetting
gsettings set sm.puri.phosh.osk.Terminal shortcuts "['<ctrl>a', '<ctrl>e', '<ctrl>r']"
For valid values see documentation of gtk_accelerator_parse():
<https://docs.gtk.org/gtk3/func.accelerator_parse.html> One can also add plain <ctrl> and <alt> keys.
These then act as latched keys until the next regular key is pressed.
IGNORINGACTIVATION
For some applications you might not want to unfold the OSK when the application requests it. This can
e.g. be useful when you usually read what the application displays (and hence want to use as much as
screen space as possible) but the application focuses a text entry. By adding the application's app-id to
the ignore-activation list you can prevent the automatic unfold. The OSK can still be unfolded by other
means (e.g. via the DBus API or the OSK button in Phosh). To determine an applications app-id you can use
the foreign-toplevel command.
gsettings set sm.puri.phosh.osk ignore-activation "['org.gnome.Calculator']"
HARDWAREKEYBOARDS
By default the on screen keyboard will now show if it detects a connected hardware keyboard. To make it
show nevertheless use
gsettings set sm.puri.phosh.osk ignore-hw-keyboards false
KEYPRESS
By default moving the finger while pressing a character will cancel the gesture and not input it. This
can be changed by enabling key-drag:
gsettings set sm.puri.phosh.osk osk-features "['key-drag']"