I am trying to play with Espanso and I have two problems:
home-manager does not install the espanso package, I have to also include the espanso-wayland package under the home.packages = with pkgs; [ list in my home.nix file.
it does create the ~/.config/espanso directory with the ~/.config/espanso/matches subdirectory, but it does not create the ~/.config/espanso/config directory, so espanso gives an error instead of starting. It works if I manually create the config directory.
Neither setting package = pkgs.espanso-wayland; nor wayland = true; installed the package. I added the configs line in a vain attempt to create it based on the default example given in the espanso entry of man home-configuration.nix
Nobody else seems to be having these problems when I search. What am I doing wrong?
does that help? I have some trouble between HM generations and will need to unregister the service and register the service. Not enough motivation to track that down until now.
That does create the directory, but espanso still doesn’t start. When I explicitly run espanso start or espanso daemon it throws errors.
journalctl --user -xeu espanso.service results in this:
worker(4283)] [ERROR] Unable to open EVDEV devices, this usually has to do with permissions.
worker(4283)] [ERROR] You can either add the current user to the 'input' group or run espanso as root
worker(4283)] [ERROR] thread 'engine thread' panicked at 'failed to initialize detector module: detection source initialization failed': espanso/src/cli/worker/engine/mod.rs:141
worker(4283)] [ERROR] Unable to block the LinuxEventLoop: receiving on an empty and disconnected channel
worker(4283)] [ERROR] thread 'main' panicked at 'unable to run main eventloop: receiving on an empty and disconnected channel': espanso/src/cli/worker/mod.rs:160
daemon(4277)] [ERROR] received unexpected exit code from worker 101, exiting
thread 'main' panicked at espanso/src/cli/launcher/mod.rs:213:45
launch daemon: unexpected error, 'espanso daemon' returned a non-zero exit code.
with `RUST_BACKTRACE=1` environment variable to display a backtrace
in process exited, code=exited, status=101/n/a
I am running unstable. Behavior has changed recently, but I can start it and I can register and unregister the service. Not enough time to get down to the root of the problem yet
There seems to be some general problems with espanso. While it was working fine with just the package in unstable, after a recent rebuild I was reminded that I had to use a workaround outlined in
It looks like that does not work for me. When I tried that solution, it still gives me this error:
The user systemd session is degraded:
UNIT LOAD ACTIVE SUB DESCRIPTION
● espanso.service not-found failed failed espanso.service
Legend: LOAD → Reflects whether the unit definition was properly loaded.
ACTIVE → The high-level unit activation state, i.e. generalization of SUB.
SUB → The low-level unit activation state, values depend on unit type.
1 loaded units listed.
Because it says it’s degraded, I am going to reboot and see if that does anything.
REBOOTED:
It is apparently starting now, but espanso still does nothing. Nothing triggers. I think I’ll have to make a new thread about this since the issue in my original question is already resolved.
~
87% ➜ :now
:now: command not found
~
87% ➜ espanso service unregister && espanso service register
disabling espanso systemd service
Removed '/home/user/.config/systemd/user/default.target.wants/espanso.service'.
deleting espanso systemd entry
service unregistered correctly!
creating service file in "/home/user/.config/systemd/user/espanso.service"
enabling systemd service
Created symlink '/home/user/.config/systemd/user/default.target.wants/espanso.service' → '/home/user/.config/systemd/user/espanso.service'.
service registered correctly!
~
87% ➜ systemctl --user stop espanso.service
~
87% ➜ systemctl --user start espanso.service
~
87% ➜ systemctl --user status espanso.service
● espanso.service - espanso
Loaded: loaded (/home/user/.config/systemd/user/espanso.service; enabled; preset: ignored)
Active: activating (auto-restart) (Result: exit-code) since Thu 2024-10-31 09:43:26 CST; 2s ago
Invocation: d7e8a616c71347e7a132e6c54c1ffedc
Process: 168007 ExecStart=/nix/store/1kzp0d57fi1z1gr7kfpvz9ixahccai41-espanso-2.2-unstable-2024-05-14/b>
Main PID: 168007 (code=exited, status=101)
Mem peak: 15.6M
CPU: 177ms
~ took 6s
87% ➜ espanso match exec --trigger :now
unable to exec match: Worker process is not running, please start Espanso first.
~
86% ➜ espanso daemon
09:45:50 [daemon(169160)] [INFO] reading configs from: "/home/user/.config/espanso"
09:45:50 [daemon(169160)] [INFO] reading packages from: "/home/user/.config/espanso/match/packages"
09:45:50 [daemon(169160)] [INFO] using runtime dir: "/home/user/.cache/espanso"
09:45:50 [daemon(169160)] [INFO] system info: NixOS v24.11 - kernel: 6.6.58
09:45:50 [daemon(169160)] [WARN] keyboard layout watcher couldn't determine active layout.
09:45:50 [daemon(169160)] [INFO] espanso version: 2.2.1
09:45:50 [daemon(169160)] [INFO] spawning the worker process...
09:45:50 [daemon(169160)] [INFO] watching for changes in path: "/home/user/.config/espanso"
09:45:50 [daemon(169160)] [INFO] binded to IPC unix socket: /home/user/.cache/espanso/espansodaemonv2.sock
09:45:50 [worker(169166)] [INFO] reading configs from: "/home/user/.config/espanso"
09:45:50 [worker(169166)] [INFO] reading packages from: "/home/user/.config/espanso/match/packages"
09:45:50 [worker(169166)] [INFO] using runtime dir: "/home/user/.cache/espanso"
09:45:50 [worker(169166)] [INFO] system info: NixOS v24.11 - kernel: 6.6.58
09:45:50 [worker(169166)] [INFO] binded to IPC unix socket: /home/user/.cache/espanso/espansoworkerv2.sock
09:45:50 [worker(169166)] [INFO] using WaylandAppInfoProvider
09:45:50 [worker(169166)] [WARN] EVDEV backend is being used, but without enabling linux capabilities.
09:45:50 [worker(169166)] [INFO] monitoring the status of the daemon process
09:45:50 [worker(169166)] [WARN] Although you CAN run espanso EVDEV backend as root, it's not recommended due
09:45:50 [worker(169166)] [WARN] to security reasons. Espanso supports linux capabilities to limit the attack surface
09:45:50 [worker(169166)] [WARN] area by only leveraging on the CAP_DAC_OVERRIDE capability (needed to work with
09:45:50 [worker(169166)] [WARN] /dev/input/* devices to detect and inject text) and disabling it as soon as the
09:45:50 [worker(169166)] [WARN] initial setup is completed.
09:45:50 [worker(169166)] [INFO] detection module will use this keyboard layout: [R=, M=, L=us, V=, O=]
09:45:50 [worker(169166)] [INFO] using EVDEVSource
09:45:50 [worker(169166)] [ERROR] Unable to open EVDEV devices, this usually has to do with permissions.
09:45:50 [worker(169166)] [ERROR] You can either add the current user to the 'input' group or run espanso as root
09:45:50 [worker(169166)] [ERROR] thread 'engine thread' panicked at 'failed to initialize detector module: detection source initialization failed': espanso/src/cli/worker/engine/mod.rs:141
09:45:50 [worker(169166)] [ERROR] Unable to block the LinuxEventLoop: receiving on an empty and disconnected channel
09:45:50 [worker(169166)] [ERROR] thread 'main' panicked at 'unable to run main eventloop: receiving on an empty and disconnected channel': espanso/src/cli/worker/mod.rs:160
09:45:50 [daemon(169160)] [ERROR] received unexpected exit code from worker 101, exiting
~ took 7s
85% ➜ espanso start
unable to start service: timed out
Hint: sometimes this happens because another Espanso process is left running for some reason.
Please try running 'espanso restart' or manually killing all Espanso processes, then try again.
~ took 7s
85% ➜ espanso restart
espanso is not running!
unable to start service: timed out
Hint: sometimes this happens because another Espanso process is left running for some reason.
Please try running 'espanso restart' or manually killing all Espanso processes, then try again.