readme: Document usage with phosh-osk-stub
readme: Add information about contributing
README: Mention phosh-osk-stub
swipeGuess is a completion program intended to be used as a plugin for touchscreen-keyboards on mobile devices.
For each line input from stdin, it looks through a wordlist and outputs the first possible match for that gesture.
it's run like input-program | swipeGuess wordlist.txt | output-program
swipeGuess also provides options for returning multiple results and ignoring certain characters. See the man page for more information.
The input program should output a stream of letters "swiped through", then a newline.
This is supported by wvkbd since version 0.6 and phosh-osk-stub since 0.28.0.
This should be a list of words, sorted by preferability of choice.
Good starting points can be found on the web, based on your language.
The most basic sorting technique would put longest words first, otherwise, it may be impossible to type them.
# Good autocompletion for terminal
ls $PATH | awk '{ print length, $0 }' | sort -nr | cut -d" " -f2- > binsSorted.txt
Smarter sorting would be keyboard-layout aware. mapScore can do that for you
./mapScore map.tsv <words.txt | sort -nr | cut -f2 > wordsSorted.txt
map.tsv uses tabs and newlines to create the grid-based layout. See map.qwerty.noapos.tsv
for a sample of how to format this file.
If your keys are in a hexagonal layout, use mapScore like
./mapScore map.simple.tsv bee
.
(mapScore.py
was the old version of this, and probably should be removed, being slower and with less features.).
completelyTypeWord.sh
(included in this repository) will type the characters (besides the first character, which is already typed by wvkbd) using wtype.gcc swipeGuess.c -o swipeGuess
.~/.local/bin/
or /usr/local/bin/
for example)wvkbd-mobintl -O | swipeGuess /path/to/words.txt | completelyTypeWord.sh
KEYBOARD_ARGS='-O | swipeGuess /path/to/words.txt | completelyTypeWord.sh'
can be added to your ~/.profile to enable this (effective on restart).gsettings set sm.puri.phosh.osk osk-features "['key-drag']"
gsettings set sm.puri.phosh.osk.Completers.Pipe command 'swipeGuess /usr/share/swipeGuess/words/words-qwerty-en 5 | tr "\t" "\n"'
gsettings set sm.puri.phosh.osk.Completers default pipe
gsettings set sm.puri.phosh.osk completion-mode "['manual','hint']"
phosh-osk-stub's pipe completer accepts multiple suggestions, newline separated. This can be scripted like
gsettings set sm.puri.phosh.osk.Completers.Pipe command 'sh -c "swipeGuess /usr/share/swipeGuess/words/words-qwerty-en 5 | tr \"\t\" \"\n\""'
SwipeBehaviors is a project that uses swipeGuess and provides more advanced functionality, like presenting several choices that can be picked with suggpicker.
swipeGuess is maintained by Zach DeCook, who may or may not be reached directly for related inquiries.
Patches and long-form discussions for this project are also accepted on my swipeKeyboard mailing list on sourcehut: (email/archive).
e.g.
git config sendemail.to '~earboxer/swipeKeyboard@lists.sr.ht'
git config format.subjectPrefix 'PATCH swipeGuess'
git send-email HEAD~1
(See man git-send-email
or https://git-send-email.io for more information)