3

I'm looking for a text expander, that works with Ubuntu 24.04.

Espanso doesn't work unfortunately.

Does anyone have a suggestion? I would appreciate any kind of help!

1
  • spanso should work. The daeom is buggy. Execute these commands and and then try again: espanso unregister ; espanso register ; espanso restart
    – dhm
    Commented May 13 at 17:48

2 Answers 2

3

Espanso

Apart from Espanso, there is no dedicated text expansion software on Linux. Espanso, however, has its problems on Wayland. When I tried installing it, I also could not get the daemon to listen. The hint given in the comment by user9101329, i.e., executing espanso unregister ; espanso register ; espanso restart in the terminal may or may not fix the issue with the daemon.

Custom script

For a much longer time, though, I use a custom script very much to my satisfaction. It is a script based on Dmtri Popov's "snippy" script featured in Linux Magazine (2014), adapted to work on Wayland.

Abbreviations are saved in separate text files in a folder. The script works by selecting the abbreviation you typed, then replacing it with the full text. I assign the script to a shortcut key (I use Ctrl+,), so typing for example emlCtrl+, inserts my full address.

The script uses wl-clipboard to manipulate the clipboard, and dotool (git.sr.ht/~geb/dotool to simulate keyboard input. You also can use ydotool instead. ydotool in the Ubuntu software repositories is outdated, even in 24.04, so you better compile it yourself if you want to use it. I currently prefer dotool, which also is (rather) easy to compile and install manually.

A minimal version of the script that already does the basics is:

#!/bin/bash
# Dependencies: wl-clipboard; dotool

SNIPPYDIR=$HOME/.local/share/snippy
echo key ctrl+shift+left | dotoolc
wl-copy -n < "$SNIPPYDIR/$(wl-paste -n -p)"
echo key ctrl+v | dotoolc

A more complex version that saves and restores current text on the clipboard is here.

2
  • Dude, thanks so much for the tip with Espanso and the script! I think, at this point I'll just live without a text expander, since trying out the sript including compiling ydotoll is too time-consuming for me right now. If I do find the time in the future, I will report back, if I got the script working! Thanks again :) Commented May 15 at 8:02
  • 1
    If this answer resolved your question, then please show your appreciation by "accepting" it: click the checkmark next to the answer. If the script does not work right away on your system, or in a specific application, you may need to introduce a small delay before the last statement (e.g. sleep 0.1).
    – vanadium
    Commented May 16 at 8:38
0

Espanso or AutoKey using X11 (Xorg)

I really want to make the permanent move to Wayland. Unfortunately, the only reliable solution I have found for text expansion is to revert back to X11 (Xorg) on my distros. Then, using Espanso or Autokey. You can switch from Wayland to X11 before logging in, you should see it in the lower left-side of the log-in screen for Ubuntu. Autokey app for text expansion automation

New contributor
Black Christian Geek is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • There is already an answer getting it working on Wayland.
    – David
    Commented 21 hours ago

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .