Autocomplete on macOS
Boo: Text suggestions on macOS

Auto-complete on mobile devices helps to save a ton of time and screen taps.

But have you ever wanted something similar on the desktop?

Mac OS X (or is it macOS, now?) has just such a feature built in: you start typing a sentence and, when you want to see a list of autocomplete suggestions, you tap the ESC button.

I wondered if there was something similar for Linux. Thankfully I didn’t have to wait long…

Linux Text Expander and Autocomplete

Bharadwaj Raju e-mailed us to share a new tool he’s been working on that brings autocomplete and text expanding features to the Linux desktop.

It’s not a like-for-like replacement, but it comes close. Raju explains more: “[TextSuggest is] a script that suggests and expands words as you type. [It is] basically the suggestions on a mobile touch keyboard, but for the Linux desktop”. 

The tool, which uses the English Open Word List to draw its suggestions from, has three key features:

  • Word insert (where you search for a word and hit enter to insert it)
  • Suggestions (where you see words based on currently highlighted text)
  • Text expansion (where you can enter entire sentences by typing an abbreviation)

This latter feature is especially helpful.

For instance, you could create a text expansion rule that lets you hit Ctrl+Shortcut, type ‘esig’ and have your entire email signature line (or a common phrase, a canned reply, or anything else that takes too much effort to type manually).

text suggest word expander
Pretend I was typing an e-mail…

To create your own custom text-expanding abbreviations you will need to create a new plaintext document called ‘.Custom_Words.txt’ in your home folder. Structure your abbreviations as follows:

abrv=Abbreviation
esig=Thanks, Joey-Elijah Sneddon
wiwte=Words I want to enter
ymmv=Your milage may vary!

And so on.

Install TextSuggest for Linux

text suggest for tweets

Text Suggest is free, open-source software but currently only supports English.

The tool requires xdotool, libxdo3, and xclip to be installed, plus a forked version of dmenu (dmenu2) to show the pop-over word finding interface. With those dependencies in mind it shouldn’t be too much of a surprise to know that this tool only works on X11 display server, and not Wayland or Mir.

Once installed you’ll need to assign custom keyboard shortcuts for ‘textsuggest’ and ‘textsuggest –noselect’, which will open the relevant prompt when pressed.

Assign Custom Keyboard Shortcuts
Assign Custom Keyboard Shortcuts through System Settings

While TextSuggest is not the most straightforward tool to get up and running — I’d advise anyone uncomfortable fiddling around with hidden files to give it a miss — you will find everything you need to get started (including a .deb installer for Ubuntu 16.04 LTS and above) on the GitHub project page linked to below.

Go to TextSuggest on GitHub

Apps
#text expander #textsuggest