Simple utility to turn swipes into words -- "plugin" for wvkbd to enable swipe-typing under wayland SXMO.
Diffstat (limited to 'README.md')
-rw-r--r--README.md67
1 files changed, 53 insertions, 14 deletions
diff --git a/README.md b/README.md
index 5dfadda..1137291 100644
--- a/README.md
+++ b/README.md
@@ -4,15 +4,15 @@ swipeGuess is a completion program intended to be used as a plugin for touchscre
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.sh wordlist | output-program`
+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](https://git.sr.ht/~earboxer/swipeGuess/tree/master/item/swipeGuess.1.scd) for more information.
## input-program
The input program should output a stream of letters "swiped through", then a newline.
-There's a WIP Merge Request towards proycon's wvkbd for an example of this.
-
-=> https://github.com/proycon/wvkbd/pull/1
+This is supported by [wvkbd](https://github.com/proycon/wvkbd) since version 0.6 and [phosh-osk-stub](https://gitlab.gnome.org/guidog/phosh-osk-stub) since 0.28.0.
## wordlist
@@ -27,6 +27,7 @@ Good starting points can be found on the web, based on your language.
* https://raw.githubusercontent.com/dwyl/english-words/master/words.txt - 466,550 words, including many proper nouns like names.
* https://norvig.com/ngrams/count_1w.txt - 333,333 words, abbreviations, etc, sorted by popularity.
* https://www.keithv.com/software/wlist/index.php - page with several links providing intersections between english word lists (26,680 - 1,516,998 words)
+* Your computer may have a list installed already in /usr/share/dict/, or one may be installable through your package manager.
### sorting tips
@@ -38,18 +39,18 @@ ls $PATH | awk '{ print length, $0 }' | sort -nr | cut -d" " -f2- > binsSorted.t
```
-Smarter sorting would be keyboard-layout aware. mapscore.py can do that for you
+Smarter sorting would be keyboard-layout aware. mapScore can do that for you
```sh
-./mapScore.py map.tsv <words.txt | sort -nr | cut -f2 > wordsSorted.txt
+./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.simplegrid.tsv` for a sample of how to format this file.
+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.
-### alternate formats
+If your keys are in a hexagonal layout, use mapScore like
+`./mapScore map.simple.tsv bee`.
-Alternatively, for performance, you can use a directory with the following format: each file is named with the first and last letters of the contained words.
-The script `makeDir.sh` is provided to help create these.
+(`mapScore.py` was the old version of this, and probably should be removed, being slower and with less features.).
## output-program
@@ -57,7 +58,45 @@ The script `makeDir.sh` is provided to help create these.
# Installation/Usage with wvkbd
-1. Be using a wayland-based graphical shell (such as sway)
-2. copy swipeGuess.sh and completelyTypeWord.sh into your $PATH (`~/.local/bin/` or `/usr/local/bin/` for example)
-3. `wvkbd-mobintl -O | swipeGuess.sh /path/to/words.txt | completelyTypeWord.sh`
- * In SXMO, `KEYBOARD_ARGS='-O | swipeGuess.sh /path/to/words.txt | completelyTypeWord.sh'` can be added to your ~/.profile to enable this (effective on restart).
+1. Be using a wayland-based graphical shell (such as sway), and have wtype installed.
+2. Compile with your favorite C compiler: `gcc swipeGuess.c -o swipeGuess`.
+2. copy swipeGuess and completelyTypeWord.sh into your $PATH (`~/.local/bin/` or `/usr/local/bin/` for example)
+3. `wvkbd-mobintl -O | swipeGuess /path/to/words.txt | completelyTypeWord.sh`
+ * In SXMO, `KEYBOARD_ARGS='-O | swipeGuess /path/to/words.txt | completelyTypeWord.sh'` can be added to your ~/.profile to enable this (effective on restart).
+
+# Usage with phosh-osk-stub
+
+```
+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']"
+```
+
+## Multiple suggestions
+
+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\""'
+```
+
+# Extended information
+
+[SwipeBehaviors](https://git.sr.ht/~earboxer/SwipeBehaviors) is a project that uses swipeGuess and provides more advanced functionality, like presenting several choices that can be picked with [suggpicker](https://git.sr.ht/~earboxer/suggpicker).
+
+# Contributing
+
+swipeGuess is maintained by [Zach DeCook](https://zachdecook.com/), 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](mailto:~earboxer/swipeKeyboard@lists.sr.ht)/[archive](https://lists.sr.ht/~earboxer/swipeKeyboard)).
+
+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)