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!
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.
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.
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
sleep 0.1
).
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
espanso unregister
;espanso register
;espanso restart