Skip to main content
Topic: espanso text expander on not systemd (hacky work around) (Read 356 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

espanso text expander on not systemd (hacky work around)

Hi all. A while back a colleague of mine told me to try out espanso, a text expander. I can honestly say it is like having nvim shortcuts or aliases, but available in every application, as it runs as a daemon.

It's official daemon utiliizes systemd on linux, but the developer provides a command to run it as a daemon if you just want to test it out  (espanso start --unmanaged).  Upon experimenting with it, I found simply putting this command into your startup commands, say in your .xinitrc, works just fine...but...it sends an annoying notification to you every time it starts (i.e. whenever you boot into your DE/WM). I found this annoying and went digging through its rust files so I could get rid of these messages.

To do this, you'll need to compile the package from source, there are instructions on how to do so here:

https://espanso.org/docs/install/linux/

Code: [Select]
cargo install --force cargo-make --version 0.34.0

Code: [Select]
# Clone the Espanso repository
git clone https://github.com/federico-terzi/espanso
cd espanso

Prior to compiling the binary, delete the notification messages from the notifications.rs file located at

Code: [Select]
./espanso/src/worker/ui

In the notification.rs file, comment out or delete all lines beginning with 'start.notify'

Then return to the root of the project directory (espanso), and compile the binary:

Code: [Select]
# Compile espanso in release mode
# NOTE: this will take a while (~5/15 minutes)
cargo make --profile release build-binary

Move the compiled binary to somewhere in your $PATH:

Code: [Select]
sudo mv target/release/espanso /usr/local/bin/espanso

And finally in your .xinitrc or startup scripts file, simply add:

Code: [Select]
espanso start --unmanaged &

And now you have espanso running in your background without systemd, without annoying notifications, and without having to write an init script. It's a hacky workaround I know, but I thought I might share as this software has been a godsend akin to discovering aliases and/or customized vim shortcuts.

EDIT: Upon further consideration, I realize now this probably should have gone into the Application/Software Section of the Forums. My apologies.