OK. I had to restart for things to work.
The port to NixOS 25.11 is working. But Espanso is not always working after computer sleep on my machine. I had to restart it to make it work again.
Are you also experiencing this problem?
I created a service to restart Espanso after sleep. It works with dbus so it depends on Gnome.
{
pkgs,
lib,
...
}:
{
# Service that listens for resume events via D-Bus
systemd.user.services.espanso-dbus-resume = {
enable = true;
description = "Restart Espanso on resume (D-Bus triggered)";
serviceConfig = {
Type = "simple";
Restart = "always";
};
script = lib.getExe (
pkgs.writeShellApplication {
name = "espanso-dbus-resume-listener";
runtimeInputs = with pkgs; [
dbus
This file has been truncated. show original
services.espanso = {
enable = true;
package = pkgs-unstable.espanso-wayland;
};
on Niri, but nothing triggers :-/
EDIT: just found out that on wayland, need to set the layout if non-US and I’m not US ^^ it works now
Even with the service, Espanso is not always working even when its status is saying that it is running. So, I am removing it.
Have you tried to change the backend setting? For Zen I had to add a per-app config to force clipboard, and set inject as the default one (instead of auto)
No. I just moved to Niri from Gnome. Maybe, I’ll try back.
bew
January 23, 2026, 8:42am
28
You might be interested in this PR, it solved ~all my issues with auto-pasting in apps on Wayland (KDE)
dev ← bew:fix-wezterm-wayland-paste
opened 07:36PM - 01 Jan 26 UTC
Hello!
(note: this was fully Human-made, zero AI involved)
> [!NOTE]
> Ed… it: Skimming GH issues mentioning `Wayland`, I think this PR could fix the following issues:
> #2428 #2162 #2270 #2497 #2582 #1670 #2340 #901 #1367
> (maybe more, to be confirmed)
### Context
Since I had to switch to Wayland a few months ago, I've always had trouble with Espanso and attributed it to some weirdness around Wayland, protocol instabilities, KDE Plasma6.. (and the missing capability on NixOS)
For example some expansions would work in Firefox but not all, and almost no expansions would work in Wezterm (the trigger is removed but the replacement is not pasted).
Other times it would simply paste the wrong clipboard data, as if Espanso didn't set the clipboard at all.
And when I had something like `foo` in my clipboard, tried an expansion that failed, I couldn't paste the original `foo` that was supposed to be restored by Espanso after the expansion.
Since latest NixOS 25.11 release, the capability issue was fully resolved and I was still having these weird issues..
The first day of 2026 motivated me to dive in and actually fix this! 😀
### Findings
With `WAYLAND_DEBUG=1` and some additional debug logs I've found that the MIME type of the copied text is set correctly then immediately overwritten to a bad type:
```
...
[ 442709.543] {Default Queue} -> wl_data_device_manager#7.get_data_device(new id wl_data_device#3, wl_seat#6)
[ 442741.732] {Default Queue} -> wl_data_device_manager#7.create_data_source(new id wl_data_source#11)
...
!! NOTE: The clipboard is set here
[ 442747.844] {Default Queue} -> wl_data_device#3.set_selection(wl_data_source#11, 35716)
!! NOTE: The data type is set correctly here (`offer` line)
[ 442747.880] {Default Queue} wl_data_device#3.data_offer(new id wl_data_offer#4278190080)
[ 442747.891] {Default Queue} wl_data_offer#4278190080.offer("text/plain;charset=utf-8") // <- here
[ 442747.900] {Default Queue} wl_data_device#3.selection(wl_data_offer#4278190080)
...
!! BAD: The data type is ~immediately overwritten to a bad type
[ 442748.373] {Default Queue} wl_data_device#3.data_offer(new id wl_data_offer#4278190081)
[ 442748.383] {Default Queue} wl_data_offer#4278190081.offer("l�4��U") // <- here
[ 442748.390] {Default Queue} wl_data_device#3.selection(wl_data_offer#4278190081)
...
```
And this weird MIME type was also used when restoring the original clipboard content, easy to validate with `wl-paste --list-types`.
In Wezterm, I've found that only selection with MIME type `text/plain;charset=utf-8` can be pasted, so the weird `l�4��U` type doesn't cut it and nothing can be pasted after Espanso changed the clipboard.
It probably worked better in Firefox because the browser have a lot more flexibility on the kind of data that can be pasted, potentially doing its own detection.
### The fix
I'm not exactly sure why the MIME type was immediately overwritten after being correct for less than a second.
I tried to disable Klipper (KDE's clipboard manager) which might have caused this but I still had the same issue.
👉 Anyway, manually setting the MIME type fixes everything for me, and all my expansions work everywhere.
### Thoughts
The clipboard restoration might need a better impl, to actually restore the original MIME type instead of forcing plain text. I'd prefer to do this in a separate PR though.
Also is there a reason the `wl-clipboard` crate isn't used, instead of calling `wl-copy` & `wl-paste` cli?
(using the cli is probably easier to do / think about 👀)