A downloadable tool for Linux

AutoComplete and Text Expansion on Linux (X11)

Get word suggestions, use text expansions, shortcuts and other useful typing boosters to type faster and better.


Free and Open Source Software, Licensed under the GNU GPL 3+.
For source code, bug reports, and more info: bharadwaj-raju/TextSuggest (GitLab)



Features

Click on these for more info:

Fast


TextSuggest is extremely fast. It does a fuzzy search of the full included English dictionary in 0.0005 seconds.

Universal Autocomplete


TextSuggest can provide autocomplete in any GUI app on X11.

Text Expansions, and more


TextSuggest can handle a range of expansions.

Custom words

Simply add them to ~/.config/textsuggest/custom-words.json in a JSON format like this:

{
    "custom": "Expansion",
    "another": "Another expansion"
}

and whenever 'custom' is typed, 'Expansion' will be typed. Similarly for 'another' ('Another expansion').

Whenever you type an unknown word, it is automatically added to your custom words file.

Commands

Inserts the output of a command:

$ls -l

when typed into a TextSuggest window, will insert output of ls -l as if it was run in a shell.

Custom words + Commands

Add in ~/.config/textsuggest/custom-words.json:

"custom": "$ command --opts"

and whenever you type 'custom' into TextSuggest, the output of command --opts will be inserted.

Math

Simply type into TextSuggest:

= 2 + 3

And '5' will be inserted. You can do any math expression that Python supports.

You can also use any function in the Python math library, for example = sqrt(25) for √25.

Custom Words + Math

Add in ~/.config/textsuggest/custom-words.json:

"custom": "= 2 + 3"

And whenever you type 'custom' into TextSuggest, 5 will be inserted.

Fuzzy Matching


TextSuggest supports very fast and intuitive fuzzy matching, so that you don't have to type the entire word, only portions. For example, as the screenshot at the top shows, `inting` shows suggestions for `interesting`, `painting` and so on, in order of best match.

Extensions


TextSuggest supports powerful *processors* for extensions. A processor processes text before handing it over to TextSuggest to type it out. By default TextSuggest has two processors, command and math_expression (see the above Text Expansions section).

Making your own extension

A processor is a simple script/executable (any language), that must respond to matches {text} and process {text} as command line arguments.

Look into this example, written in Python (you can use any language, as long as it is an executable):

import sys
if sys.argv[1] == "matches":
    # Exit (sys.exit()) with 0 (yes) or 1 (no): whether this processor should process 'text' or not.
    # For example, the command processor has it like this:
    #     if text.startswith('$'):
    #         sys.exit(0)  # should process
    #     else:
    #         sys.exit(1)  # should not process<p></p>
if sys.argv[1] == "process":
    text = sys.argv[2]
    # Do something with 'text' and print() it.
    # This is what will be finally typed.

Make one based on the sample above, and place it in ~/.config/textsuggest/processors/.

File must be executable (chmod a+x ~/.config/textsuggest/processors/YOUR_PROCESSOR).

Processors in ~/.config/textsuggest/processors take precedence over those in /usr/share/textsuggest/processors, in case of a name or match conflict.

History


TextSuggest supports storing history of suggestions used. More-used suggestions will rise to the top. History can be disabled using the --no-history option. You can remove a word from history, by pressing Shift+Delete, or in the file ~/.config/textsuggest/history.json

"Ignore" Certain Words


You can tell TextSuggest to *never* show some words conveniently through - Ctrl+Shift+Delete - or in the file ~/.config/textsuggest/ignore.json

Keyboard Shortcuts


While browsing the list of suggestions, press - Alt+Enter to type it without processing. - Shift+Delete to remove it from your history. - Ctrl+Shift+Delete to add it to the ignore list (i.e. will never show up in suggestions)

Native UI


Unlike many apps, TextSuggest has a fast, entirely native user interface written in Qt 5 and C++. Custom third-party UIs can also be easily made by other developers if they wish.

Multiple Languages


All languages are supported!

English dictionary are provided by default. Please search online for dictionaries of your language.

By default, only the English dictionary will be used. Use --language={your_language} option to change this.

Then TextSuggest will use {your_language}.txt file(s) in /usr/share/textsuggest/dictionaries/ (if they exist).

For example, if you want TextSuggest to use, let us say, English and Telugu dictionaries:


$ textsuggest --language=English --language=Telugu

and so on (note that --language=English,Telugu or --language English Telugu will not work, you must specify --language flag for each).

TextSuggest also has an optional feature to auto-detect your language from your keyboard layout. Use --auto-detect-language option for this.

TextSuggest can auto-detect language from following keyboard layouts:

  • bd → Bangla
  • us → English
  • uk → English
  • gb → English
  • cn → Chinese
  • ar → Arabic
  • tw → Chinese
  • de → German
  • jp → Japanese
  • ru → Russian
  • es → Spanish
  • se → Swedish
  • fi → Finnish
  • kr → Korean
  • pk → Urdu
  • fr → French
  • gr → Greek
  • ua → Ukrainian

Even if your language is not listed above, that only means that TextSuggest will not be able to auto-detect it from your keyboard layout! You can still specify it manually using --language={your_language} and it will work!

Options

Options for textsuggest to use its features
$ textsuggest --help
usage: textsuggest [options]
TextSuggest — universal autocomplete
optional arguments:
  -h, --help            show this help message and exit
  --word WORD [...]
                        Specify word to give suggestions for. Default: all words.
  --no-history          Disable the frequently-used words history (stored in ~/.config/textsuggest/history.json)
  --language languages [...]
                        Set language(s). Default: English. See also: --auto-detect-language.
  --auto-detect-language
                        Auto-detect language from keyboard layout.
  --selection           Show suggestions for currently selected word. See also: --auto-selection
  --auto-selection [beginning|middle|end]
                        Automatically select word under cursor and suggest. Ignored if --no-selection.
  --custom-words-only   Show custom words only.
  --no-processing       Disable using of any processors.
  -v, --version         Print version and license information.
StatusReleased
CategoryTool
PlatformsLinux
Rating
Rated 4.0 out of 5 stars
(1 total ratings)
Authorbharadwaj-raju
Code licenseGNU General Public License v3.0 (GPL)
Average sessionA few seconds
InputsKeyboard, Mouse
LinksSource code

Download

Download
TextSuggest-v4.2.5.zip 36 MB

Install instructions

Install xclip and xdotool.

 Extract the ZIP file, and run:

$ cd {path to extracted files}
$ sudo sh install.sh

Usage

Run the command textsuggest-server in the background, and set it to run on startup.

Set the command textsuggest to a keyboard shortcut. Type a word, select it, press the shortcut and TextSuggest will give you autocomplete.

This offers the most basic use of TextSuggest. For more, see options and click on the features.

Comments

Log in with itch.io to leave a comment.

Hi, I cannot install this app, because I do not have sudo or root authority. Is there any other solutions? Thanks.

Hi, I like this tool, but using it under Cinnamon seems to freezes my desktop for a couple of seconds after choosing a word, no matter what application I use it in. Any suggestions?

(1 edit)

Would love to check this app out, but I'm getting an error and I'm not sure if that's because I'm using Wayland or something else is wrong.

$ textsuggest-server

/usr/bin/textsuggest-server: line 3: /usr/share/textsuggest/textsuggest-server: cannot execute binary file: Exec format error


It is my understanding that Wayland has an X emulator or something similar built in so figured I would give it a go. 


I'm running mobian (debian) on pinephone.


EDIT
I compiled the binaries myself for arm and did get it to run. However, it doesn't work correctly because..


qt.qpa.wayland: Wayland does not support QWindow::requestActivate()

Anyway, thanks for your time. Hopefully I can find something to suit my needs.
(1 edit)

Hello @bharadwaj-raju!

I downloaded prebuilt package and tried to run textsuggest-server, but got the following result:

$ textsuggest-server 
/usr/bin/textsuggest-server: line 3: /usr/share/textsuggest/textsuggest-server: Permission denied

It seems that textsuggest-server binary tries to run some other script or binary via shell but target don't have appropriate rights.

I use Ubuntu 18.04.

Try sudo chmod a+x /usr/share/textsuggest/textsuggest-server.


The install script should've done this automatically, I'll see why it didn't work. Thanks for reporting.

That was not the problem. I added execution rights (chmod +x) to all libraries inside /usr/share/textsuggest/libs/, now the server went further and says:

textsuggest-server: symbol lookup error: /lib/x86_64-linux-gnu/librt.so.1: undefined symbol: __clock_nanosleep, version GLIBC_PRIVATE

I suppose that my version of librt.so isn't appropriate for it.

I see. I think the fix is to bundle librt as well along with everything else. I'll try to get that done within next week. Thanks again for reporting!

Please check if this build works. If it does I'll upload to itch.
https://gofile.io/d/e92CA5

Hi, thank you very much for your tools i really enjoyed-it but i have a problem to use-it. When i launch the server on a terminal he give me this error "terminate called after throwing an instance of 'std::out_of_range'" after that i use the custom shortcut to start textsuggest and the i type the Enter key he crash at this moment and he doesn't write the selected words. Thaks you for your help and sorry if my english is bad or if i paste my problem to the wrong place.


textsuggest-server

Started server at org.textsuggest.server, PID: 11219…

time get_all_words([English, English]) = 0.00136692

Adding 'prevent' to custom_words

Processing 'prevent'
   Found custom word 'prevent', expanding to 'prevent'
   Found processor 'command' from '/usr/share/textsuggest/processors/command'
   Using processor 'command' from '/usr/share/textsuggest/processors/command'

terminate called after throwing an instance of 'std::out_of_range'
 what():  basic_string::substr: __pos (which is 18446744073709551615) > this->size() (which is 0)

/usr/bin/textsuggest-server : ligne 3 : 11219 Abandon                 LD_LIBRARY_PATH=/usr/share/textsuggest/
libs /usr/share/textsuggest/textsuggest-server "$@"

(1 edit)

Hi, thanks for using my tool.


I can reproduce the issue. Sorry, I'll fix it soon.

fixed in latest release (4.2.5), please try again

Thanks for your answer ! Sadly i can't start the textsuggest-server as root but i think that's normal and it work great ! Thanks you for your time !

Now i have another problem to use multiple language with --languge=

textsuggest-server --language=English --lan
guage=French  
terminate called after throwing an instance of 'cxxopts::option_not_exists_exception'
 what():  Option ‘language’ does not exist

/usr/bin/textsuggest-server : ligne 3 : 25407 Abandon                 LD_LIBRARY_PATH=/usr/share/textsuggest/
libs /usr/share/textsuggest/textsuggest-server "$@"

For the moment i use only the English.txt with french word in it but that's alright. I have also a problem when i try to use my French.txt renamed in English.txt because he can't find anything but i think that the problem come from the .txt itself because when i copy the words in it on to the English.txt he work perfectly. Thank you for your amazing job i really apreciate-it, i try to switch to linux sooo this is hard to me to stop using this kind of stuff that other OS have.

> Thanks for your answer ! Sadly i can't start the textsuggest-server as root but i think that's normal and it work great ! Thanks you for your time !

Yes, you should start it as the normal user, not root.


> Now i have another problem to use multiple language with --languge=

I'll try to fix the language problem too, thanks for telling me.