Repository: espanso/espanso (language: rust)

Issue:
Unexpected exit code from worker 90 on Wayland
Now espanso was finally working fine on Wayland, but as of yesterday it stopped working. :/

`espanso start` appears to start espanso, but the replacements aren't working. And if I execute `espanso restart`, it says that espanso wasn't running, but it also doesn't start it.

`#acfg#` and `#pacfg#` aren't working either, but the log does say that it quit with an unexpected exit code.

```
& thefish @ hx90 in ~/fromsvngit/espanso (master ✔) 0 [11:32:36]
~ espanso log
11:32:38 [daemon(673798)] [INFO] reading configs from: "/home/thefish/.config/espanso"
11:32:38 [daemon(673798)] [INFO] reading packages from: "/home/thefish/.config/espanso/match/packages"
11:32:38 [daemon(673798)] [INFO] using runtime dir: "/home/thefish/.local/share/espanso"
11:32:38 [daemon(673798)] [WARN] keyboard layout watcher couldn't determine active layout.
11:32:38 [daemon(673798)] [INFO] watching for changes in path: "/home/thefish/.config/espanso"
11:32:38 [daemon(673798)] [INFO] espanso version: 2.1.5-beta
11:32:38 [daemon(673798)] [INFO] spawning the worker process...
11:32:38 [daemon(673798)] [INFO] binded to IPC unix socket: /home/thefish/.local/share/espanso/espansodaemonv2.sock
11:32:38 [worker(673804)] [INFO] reading configs from: "/home/thefish/.config/espanso"
11:32:38 [worker(673804)] [INFO] reading packages from: "/home/thefish/.config/espanso/match/packages"
11:32:38 [worker(673804)] [INFO] using runtime dir: "/home/thefish/.local/share/espanso"
11:32:38 [worker(673804)] [INFO] binded to IPC unix socket: /home/thefish/.local/share/espanso/espansoworkerv2.sock
11:32:38 [worker(673804)] [INFO] monitoring the status of the daemon process
11:32:38 [worker(673804)] [INFO] using WaylandAppInfoProvider
11:32:38 [worker(673804)] [INFO] detection module will use this keyboard layout: [R=evdev, M=pc86, L=us, V=dvorak-intl, O=terminate:ctrl_alt_bksp]
11:32:38 [worker(673804)] [INFO] using EVDEVSource
11:32:38 [worker(673804)] [INFO] Querying modifier status...
11:32:39 [daemon(673798)] [ERROR] received unexpected exit code from worker 90, exiting

& thefish @ hx90 in ~/fromsvngit/espanso (master ✔) 0 [11:32:41]
~
```

OS: Arch Linux
KDE: 5.24
Espanso version: latest git master

The matches file isn't corrupt and I didn't even edit it in the past few weeks.

How can we further investigate this?


Discussion / hints:
Hey @Vistaus,

I'm sorry you experienced this problem! Could you please try running the following and post the output here?

```
espanso -vvv worker
```

Cheers :)

Hey Frederico! :)

That command produced some more output:

```
& thefish @ hx90 in ~/Downloads 0 [20:20:12]
~ espanso -vvv worker
22:34:07 [worker(838091)] [DEBUG] (1) espanso_path: detected config directory in $HOME/.config/espanso
22:34:07 [worker(838091)] [DEBUG] (1) espanso_path: detected legacy runtime dir: "/home/thefish/.local/share/espanso"
22:34:07 [worker(838091)] [DEBUG] (1) espanso_path: detected default packages dir: "/home/thefish/.config/espanso/match/packages"
22:34:07 [worker(838091)] [INFO] reading configs from: "/home/thefish/.config/espanso"
22:34:07 [worker(838091)] [INFO] reading packages from: "/home/thefish/.config/espanso/match/packages"
22:34:07 [worker(838091)] [INFO] using runtime dir: "/home/thefish/.local/share/espanso"
22:34:07 [worker(838091)] [DEBUG] (1) espanso_config::config::store: loaded default config at path: "/home/thefish/.config/espanso/config/default.yml"
22:34:07 [worker(838091)] [DEBUG] (1) espanso_config::config::store: loaded config at path: "/home/thefish/.config/espanso/config/firefox.yml"
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'alacritty_terminal_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'emacs_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'gedit_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'generic_terminal_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'kitty_terminal_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'konsole_terminal_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'libreoffice_writer_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'simple_terminal_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'simple_terminal_2_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'terminator_terminal_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'termite_terminal_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'thunderbird_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'tilix_terminal_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'urxvt_terminal_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'xterm_terminal_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'yakuake_terminal_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::patch::config_store: skipping 'virtualbox_x11' patch
22:34:07 [worker(838091)] [DEBUG] (1) espanso::cli::worker: starting with start-reason = None
22:34:07 [worker(838091)] [DEBUG] (1) espanso::icon: skipping extraction for '"/home/thefish/.local/share/espanso/iconv2.png"', as it's already present
22:34:07 [worker(838091)] [DEBUG] (1) espanso::icon: skipping extraction for '"/home/thefish/.local/share/espanso/search.png"', as it's already present
22:34:07 [worker(838091)] [DEBUG] (1) espanso::icon: skipping extraction for '"/home/thefish/.local/share/espanso/icon_no_background.png"', as it's already present
22:34:07 [worker(838091)] [INFO] binded to IPC unix socket: /home/thefish/.local/share/espanso/espansoworkerv2.sock
22:34:07 [worker(838091)] [INFO] using WaylandAppInfoProvider
22:34:07 [worker(838091)] [DEBUG] (2) espanso::cli::worker::engine: using linux capabilities to grant permissions needed by EVDEV backend
22:34:07 [worker(838091)] [DEBUG] (2) espanso::cli::worker::engine: successfully granted permissions using capabilities
22:34:07 [worker(838091)] [INFO] detection module will use this keyboard layout: [R=evdev, M=pc104, L=us, V=dvorak-intl, O=]
22:34:07 [worker(838091)] [INFO] using EVDEVSource
22:34:07 [worker(838091)] [INFO] Querying modifier status...
[wayland-client error] Attempted to dispatch unknown opcode 0 for wl_shm, aborting.
fish: Job 1, 'espanso -vvv worker' terminated by signal SIGABRT (Abort)

& thefish @ hx90 in ~/Downloads 0 [22:34:08]
~
```
@Vistaus Thanks! That's interesting. Did you make some changes with your Desktop Environment? It seems something is wrong with the wayland protocol exchange
@federico-terzi No, I'm still using the same KDE Plasma that I was using before.
@Vistaus Interesting, I don't have many ideas at the moment but I'll definitely investigate :)
@federico-terzi That'd be great. Thank you for looking into it! :)
I missed Espanso too much, so I couldn't wait for this to be solved. So I switched to openSUSE Tumbleweed, eventually got Espanso to compile and now it's working again. So I'll close this issue. :)
It's back again after the Plasma 5.25 update on openSUSE Tumbleweed today. espanso can't be started anymore because of this issue... :(
The output of espanso -vvv worker is the same as above.
I hope this can be fixed. I really miss Espanso (esp. when using it for work). :(
I can reproduce this issue. 
```
❯ ./target/release/espanso daemon                                                                              at  19:25:03
19:25:03 [daemon(73121)] [INFO] reading configs from: "/home/ss/.config/espanso"
19:25:03 [daemon(73121)] [INFO] reading packages from: "/home/ss/.config/espanso/match/packages"
19:25:03 [daemon(73121)] [INFO] using runtime dir: "/home/ss/.cache/espanso"
19:25:03 [daemon(73121)] [INFO] system info: Fedora Linux v36 - kernel: 5.18.13-200.fc36.x86_64
19:25:03 [daemon(73121)] [INFO] watching for changes in path: "/home/ss/.config/espanso"
19:25:03 [daemon(73121)] [INFO] espanso version: 2.1.7-beta
19:25:03 [daemon(73121)] [INFO] spawning the worker process...
19:25:03 [daemon(73121)] [INFO] binded to IPC unix socket: /home/ss/.cache/espanso/espansodaemonv2.sock
19:25:03 [worker(73128)] [INFO] reading configs from: "/home/ss/.config/espanso"
19:25:03 [worker(73128)] [INFO] reading packages from: "/home/ss/.config/espanso/match/packages"
19:25:03 [worker(73128)] [INFO] using runtime dir: "/home/ss/.cache/espanso"
19:25:03 [worker(73128)] [INFO] system info: Fedora Linux v36 - kernel: 5.18.13-200.fc36.x86_64
19:25:03 [worker(73128)] [INFO] using WaylandAppInfoProvider
19:25:03 [worker(73128)] [INFO] binded to IPC unix socket: /home/ss/.cache/espanso/espansoworkerv2.sock
19:25:03 [worker(73128)] [WARN] this version of espanso doesn't come with modulo support, so graphical features (such as Forms and Search) might not be available
19:25:03 [worker(73128)] [WARN] EVDEV backend is being used, but without enabling linux capabilities.
19:25:03 [worker(73128)] [WARN]   Although you CAN run espanso EVDEV backend as root, it's not recommended due
19:25:03 [worker(73128)] [WARN]   to security reasons. Espanso supports linux capabilities to limit the attack surface
19:25:03 [worker(73128)] [INFO] monitoring the status of the daemon process
19:25:03 [worker(73128)] [WARN]   area by only leveraging on the CAP_DAC_OVERRIDE capability (needed to work with
19:25:03 [worker(73128)] [WARN]   /dev/input/* devices to detect and inject text) and disabling it as soon as the
19:25:03 [worker(73128)] [WARN]   initial setup is completed.
19:25:03 [worker(73128)] [INFO] detection module will use this keyboard layout: [R=, M=, L=us, V=, O=]
19:25:03 [worker(73128)] [INFO] using EVDEVSource
19:25:03 [worker(73128)] [INFO] Querying modifier status...
[wayland-client error] Attempted to dispatch unknown opcode 0 for wl_shm, aborting.
19:25:03 [daemon(73121)] [ERROR] received unexpected exit code from worker 90, exiting

```
KDE Plasma again, on Fedora Kinoite. 
Same problem under Archlinux with KDE 5.97.0 / Plasma 5.25.4 (plasma wayland session)
Please check if you have installed wl-clipboard?  At one point there was an overlooked or not-mentioned dependency for this. At one time, I believe I was getting a "worker 90" type of error. My logs:

$ espanso stop
$ espanso daemon
 21:56:15 [daemon(12924)] [INFO] reading configs from: "/home/ykill/.config/espanso"
 21:56:15 [daemon(12924)] [INFO] reading packages from: "/home/ykill/.config/espanso/match/packages"
 21:56:15 [daemon(12924)] [INFO] using runtime dir: "/home/ykill/.cache/espanso"
 21:56:15 [daemon(12924)] [INFO] system info: openSUSE Tumbleweed v20220925 - kernel: 5.19.10-1-default
 21:56:15 [daemon(12924)] [INFO] espanso version: 2.1.7-beta
 21:56:15 [daemon(12924)] [INFO] spawning the worker process...
 21:56:15 [daemon(12924)] [INFO] watching for changes in path: "/home/ykill/.config/espanso"
 21:56:15 [daemon(12924)] [INFO] binded to IPC unix socket: /home/ykill/.cache/espanso/espansodaemonv2.sock
 21:56:15 [daemon(12924)] [WARN] keyboard layout watcher couldn't determine active layout.
 21:56:15 [worker(12931)] [INFO] reading configs from: "/home/ykill/.config/espanso"
 21:56:15 [worker(12931)] [INFO] reading packages from: "/home/ykill/.config/espanso/match/packages"
 21:56:15 [worker(12931)] [INFO] using runtime dir: "/home/ykill/.cache/espanso"
 21:56:15 [worker(12931)] [INFO] system info: openSUSE Tumbleweed v20220925 - kernel: 5.19.10-1-default
 21:56:15 [worker(12931)] [INFO] binded to IPC unix socket: /home/ykill/.cache/espanso/espansoworkerv2.sock
 21:56:15 [worker(12931)] [INFO] using WaylandAppInfoProvider
 21:56:15 [worker(12931)] [INFO] monitoring the status of the daemon process
 21:56:15 [worker(12931)] [INFO] detection module will use this keyboard layout: [R=, M=, L=us, V=, O=]
 21:56:15 [worker(12931)] [INFO] using EVDEVSource
 21:56:16 [worker(12931)] [INFO] Querying modifier status...
 21:56:16 [worker(12931)] [INFO] inject module will use this keyboard layout: [R=, M=, L=us, V=, O=]
 21:56:16 [worker(12931)] [INFO] using EVDEVInjector
 21:56:16 [worker(12931)] [INFO] using WaylandFallbackClipboard

At this point, I can test, and espanso is working. I don't see any further log messages. Please excuse my formatting at this time.

I originally had used a AppImage for espanso, however I now compile from source.

I added: 
wl-clipboard-2.1.0-1.4.x86_64

My setup:
openSUSE TW current
gnome-session-wayland-43
xwayland-22.1.3-1.2


@ykill wl-clipboard is installed for me, however, it's still not working on my openSUSE TW install.
I have the same issue on Arch with KDE 5.26.2. I tried going back to the 2.1.5 beta and it still didn't work. I'm going to try going back further, but perhaps this line from the `espanso -vvv worker` output is helpful (seems like everyone above has the same error):

`[wayland-client error] Attempted to dispatch unknown opcode 0 for wl_shm, aborting.`

I'll report back if I have any success with older versions of espanso.

**Update**: I just went back and tried a few versions all the way back to espanso 2.0.3-alpha and none of them worked, so this may be an issue with a recent KDE update, because I'm quite certain I used that version on KDE Wayland about a year ago. Not sure if this is something that needs to be fixed in espanso or in KDE. 

For now it's quite unfortunate and it's making me choose between espanso and KDE.

**Update 2**: I switched to the LTS kernel (5.15.75) just in case that had any effect and that didn't help either.
I was able to fix this by updating smithay-client-toolkit (sctk) to version 0.15.4. I've submitted a PR, but before that gets merged you can fix this by building espanso from source:

1. Edit `espanso/espanso-detect/Cargo.toml`
2. In the line `sctk = { package = "smithay-client-toolkit", version = "0.14.0", optional = true }` change the version to `0.15.4`.
3. Save the changes and build espanso as normal. It should now work perfectly on KDE Plasma with Wayland.
> I was able to fix this by updating smithay-client-toolkit (sctk) to version 0.15.4. I've submitted a PR, but before that gets merged you can fix this by building espanso from source:
> 
> 1. Edit `espanso/espanso-detect/Cargo.toml`
> 2. In the line `sctk = { package = "smithay-client-toolkit", version = "0.14.0", optional = true }` change the version to `0.15.4`.
> 3. Save the changes and build espanso as normal. It should now work perfectly on KDE Plasma with Wayland.

You, lakoliu, are a true hero! I can confirm that this fixed the issue. Finally I can use espanso again! 🙂

I'm sure your PR will be accepted, so I'll close this issue.
@lakoliu You are a life saver! Can confirm it works on Fedora 36 Kinoite (KDE Plasma Wayland) :heart: 
@lakoliu thanks!
Just for completeness:
```
# Clone repo:
mkdir git
cd git
git clone https://github.com/espanso/espanso.git
cd espanso
# compile:
cargo make --env NO_X11=true --profile release build-binary
cd ~/git/espanso/target/release # or where ever you cloned it.....
# Copy to correct place:
sudo cp espanso /usr/bin/espanso
# Then:
sudo setcap "cap_dac_override+p" $(which espanso)
```
My Espanso sprang to life and started working!!!!
@xircon (And _espanso service register_ if you want it to autostart. 😉)
Already done, ages ago :smile: That is why it sprang to life.

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index cab66645..82f195f1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -10,9 +10,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
 
 [[package]]
 name = "aho-corasick"
-version = "0.7.15"
+version = "0.7.19"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5"
+checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e"
 dependencies = [
  "memchr",
 ]
@@ -166,12 +166,12 @@ dependencies = [
 
 [[package]]
 name = "calloop"
-version = "0.7.2"
+version = "0.9.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d0a1340115d6bd81e1066469091596a339f68878a2ce3c2f39e546607d22131"
+checksum = "bf2eec61efe56aa1e813f5126959296933cf0700030e4314786c48779a66ab82"
 dependencies = [
  "log",
- "nix 0.19.1",
+ "nix 0.22.3",
 ]
 
 [[package]]
@@ -582,7 +582,7 @@ dependencies = [
 
 [[package]]
 name = "espanso"
-version = "2.1.7-beta"
+version = "2.1.8"
 dependencies = [
  "anyhow",
  "caps",
@@ -1552,24 +1552,24 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
 
 [[package]]
 name = "memchr"
-version = "2.3.4"
+version = "2.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
+checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
 
 [[package]]
 name = "memmap2"
-version = "0.2.3"
+version = "0.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4"
+checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357"
 dependencies = [
  "libc",
 ]
 
 [[package]]
 name = "memoffset"
-version = "0.6.1"
+version = "0.6.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87"
+checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
 dependencies = [
  "autocfg",
 ]
@@ -1734,33 +1734,34 @@ checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
 
 [[package]]
 name = "nix"
-version = "0.19.1"
+version = "0.22.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2"
+checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf"
 dependencies = [
  "bitflags 1.2.1",
  "cc",
  "cfg-if 1.0.0",
  "libc",
+ "memoffset",
 ]
 
 [[package]]
 name = "nix"
-version = "0.20.0"
+version = "0.24.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a"
+checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc"
 dependencies = [
  "bitflags 1.2.1",
- "cc",
  "cfg-if 1.0.0",
  "libc",
+ "memoffset",
 ]
 
 [[package]]
 name = "nom"
-version = "6.2.1"
+version = "6.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c5c51b9083a3c620fa67a2a635d1ce7d95b897e957d6b28ff9a5da960a103a6"
+checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2"
 dependencies = [
  "memchr",
  "version_check",
@@ -2290,9 +2291,9 @@ dependencies = [
 
 [[package]]
 name = "regex"
-version = "1.4.6"
+version = "1.5.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a26af418b574bd56588335b3a3659a65725d4e636eb1016c2f9e3b38c7cc759"
+checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"
 dependencies = [
  "aho-corasick",
  "memchr",
@@ -2307,9 +2308,9 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
 
 [[package]]
 name = "regex-syntax"
-version = "0.6.22"
+version = "0.6.27"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581"
+checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
 
 [[package]]
 name = "remove_dir_all"
@@ -2567,9 +2568,9 @@ checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
 
 [[package]]
 name = "smithay-client-toolkit"
-version = "0.14.0"
+version = "0.15.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec783683499a2cfc85b6df3d04f83b1907b5cbd98a1aed44667dbdf1eac4e64c"
+checksum = "8a28f16a97fa0e8ce563b2774d1e732dd5d4025d2772c5dba0a41a0f90a29da3"
 dependencies = [
  "bitflags 1.2.1",
  "calloop",
@@ -2577,7 +2578,8 @@ dependencies = [
  "lazy_static",
  "log",
  "memmap2",
- "nix 0.20.0",
+ "nix 0.22.3",
+ "pkg-config",
  "wayland-client",
  "wayland-cursor",
  "wayland-protocols",
@@ -3166,14 +3168,14 @@ checksum = "acdb075a845574a1fa5f09fd77e43f7747599301ea3417a9fbffdeedfc1f4a29"
 
 [[package]]
 name = "wayland-client"
-version = "0.28.6"
+version = "0.29.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3ab332350e502f159382201394a78e3cc12d0f04db863429260164ea40e0355"
+checksum = "3f3b068c05a039c9f755f881dc50f01732214f5685e379829759088967c46715"
 dependencies = [
  "bitflags 1.2.1",
  "downcast-rs",
  "libc",
- "nix 0.20.0",
+ "nix 0.24.2",
  "scoped-tls",
  "wayland-commons",
  "wayland-scanner",
@@ -3182,11 +3184,11 @@ dependencies = [
 
 [[package]]
 name = "wayland-commons"
-version = "0.28.6"
+version = "0.29.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a21817947c7011bbd0a27e11b17b337bfd022e8544b071a2641232047966fbda"
+checksum = "8691f134d584a33a6606d9d717b95c4fa20065605f798a3f350d78dced02a902"
 dependencies = [
- "nix 0.20.0",
+ "nix 0.24.2",
  "once_cell",
  "smallvec",
  "wayland-sys",
@@ -3194,20 +3196,20 @@ dependencies = [
 
 [[package]]
 name = "wayland-cursor"
-version = "0.28.6"
+version = "0.29.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be610084edd1586d45e7bdd275fe345c7c1873598caa464c4fb835dee70fa65a"
+checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661"
 dependencies = [
- "nix 0.20.0",
+ "nix 0.24.2",
  "wayland-client",
  "xcursor",
 ]
 
 [[package]]
 name = "wayland-protocols"
-version = "0.28.6"
+version = "0.29.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "286620ea4d803bacf61fa087a4242ee316693099ee5a140796aaba02b29f861f"
+checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6"
 dependencies = [
  "bitflags 1.2.1",
  "wayland-client",
@@ -3217,9 +3219,9 @@ dependencies = [
 
 [[package]]
 name = "wayland-scanner"
-version = "0.28.6"
+version = "0.29.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce923eb2deb61de332d1f356ec7b6bf37094dc5573952e1c8936db03b54c03f1"
+checksum = "8f4303d8fa22ab852f789e75a967f0a2cdc430a607751c0499bada3e451cbd53"
 dependencies = [
  "proc-macro2",
  "quote 1.0.9",
@@ -3228,9 +3230,9 @@ dependencies = [
 
 [[package]]
 name = "wayland-sys"
-version = "0.28.6"
+version = "0.29.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d841fca9aed7febf9bed2e9796c49bf58d4152ceda8ac949ebe00868d8f0feb8"
+checksum = "be12ce1a3c39ec7dba25594b97b42cb3195d54953ddb9d3d95a7c3902bc6e9d4"
 dependencies = [
  "dlib",
  "lazy_static",
diff --git a/espanso-config/Cargo.toml b/espanso-config/Cargo.toml
index b00cc9c7..3a7b721f 100644
--- a/espanso-config/Cargo.toml
+++ b/espanso-config/Cargo.toml
@@ -11,7 +11,7 @@ thiserror = "1.0.23"
 serde = { version = "1.0.123", features = ["derive"] }
 serde_yaml = "0.8.17"
 glob = "0.3.0"
-regex = "1.4.3"
+regex = "1.5.5"
 lazy_static = "1.4.0"
 dunce = "1.0.1"
 walkdir = "2.3.1"
diff --git a/espanso-config/src/legacy/config.rs b/espanso-config/src/legacy/config.rs
index 5bb5748a..1b2bc6a9 100644
--- a/espanso-config/src/legacy/config.rs
+++ b/espanso-config/src/legacy/config.rs
@@ -654,7 +654,7 @@ impl LegacyConfigSet {
 
     // Separate default from specific
     let default = configs.get(0).unwrap().clone();
-    let mut specific = (&configs[1..]).to_vec();
+    let mut specific = configs[1..].to_vec();
 
     // Add default entries to specific configs when needed
     for config in specific.iter_mut() {
diff --git a/espanso-detect/Cargo.toml b/espanso-detect/Cargo.toml
index b97c457e..f581dbda 100644
--- a/espanso-detect/Cargo.toml
+++ b/espanso-detect/Cargo.toml
@@ -15,7 +15,7 @@ log = "0.4.14"
 lazycell = "1.3.0"
 anyhow = "1.0.38"
 thiserror = "1.0.23"
-regex = "1.4.3"
+regex = "1.5.5"
 lazy_static = "1.4.0"
 
 [target.'cfg(windows)'.dependencies]
@@ -24,10 +24,10 @@ widestring = "0.4.3"
 [target.'cfg(target_os="linux")'.dependencies]
 libc = "0.2.85"
 scopeguard = "1.1.0"
-sctk = { package = "smithay-client-toolkit", version = "0.14.0", optional = true }
+sctk = { package = "smithay-client-toolkit", version = "0.15.4", optional = true }
 
 [build-dependencies]
 cc = "1.0.73"
 
 [dev-dependencies]
-enum-as-inner = "0.3.3"
\ No newline at end of file
+enum-as-inner = "0.3.3"
diff --git a/espanso-inject/Cargo.toml b/espanso-inject/Cargo.toml
index c7724be2..37f45e8b 100644
--- a/espanso-inject/Cargo.toml
+++ b/espanso-inject/Cargo.toml
@@ -16,7 +16,7 @@ lazycell = "1.3.0"
 anyhow = "1.0.38"
 thiserror = "1.0.23"
 lazy_static = "1.4.0"
-regex = "1.4.3"
+regex = "1.5.5"
 
 [target.'cfg(windows)'.dependencies]
 widestring = "0.4.3"
diff --git a/espanso-mac-utils/Cargo.toml b/espanso-mac-utils/Cargo.toml
index cd47a4bf..427a5c03 100644
--- a/espanso-mac-utils/Cargo.toml
+++ b/espanso-mac-utils/Cargo.toml
@@ -11,7 +11,7 @@ lazycell = "1.3.0"
 anyhow = "1.0.38"
 thiserror = "1.0.23"
 lazy_static = "1.4.0"
-regex = "1.4.3"
+regex = "1.5.5"
 
 [build-dependencies]
 cc = "1.0.73"
\ No newline at end of file
diff --git a/espanso-match/Cargo.toml b/espanso-match/Cargo.toml
index 5cbf6b6b..e5d9f929 100644
--- a/espanso-match/Cargo.toml
+++ b/espanso-match/Cargo.toml
@@ -8,5 +8,5 @@ edition = "2018"
 log = "0.4.14"
 anyhow = "1.0.38"
 thiserror = "1.0.23"
-regex = "1.4.3"
+regex = "1.5.5"
 unicase = "2.6.0"
\ No newline at end of file
diff --git a/espanso-migrate/Cargo.toml b/espanso-migrate/Cargo.toml
index 07d513c3..da45d243 100644
--- a/espanso-migrate/Cargo.toml
+++ b/espanso-migrate/Cargo.toml
@@ -9,7 +9,7 @@ log = "0.4.14"
 anyhow = "1.0.38"
 thiserror = "1.0.23"
 glob = "0.3.0"
-regex = "1.4.3"
+regex = "1.5.5"
 lazy_static = "1.4.0"
 dunce = "1.0.1"
 walkdir = "2.3.1"
diff --git a/espanso-modulo/Cargo.toml b/espanso-modulo/Cargo.toml
index 332c043d..a8aaa935 100644
--- a/espanso-modulo/Cargo.toml
+++ b/espanso-modulo/Cargo.toml
@@ -12,11 +12,11 @@ serde = { version = "1.0.123", features = ["derive"] }
 anyhow = "1.0.38"
 thiserror = "1.0.23"
 lazy_static = "1.4.0"
-regex = "1.4.3"
+regex = "1.5.5"
 
 [build-dependencies]
 cc = "1.0.73"
-regex = "1.4.3"
+regex = "1.5.5"
 zip = "0.5.12"
 winres = "0.1.11"
 glob = "0.3.0"
\ No newline at end of file
diff --git a/espanso-modulo/src/sys/search/search.cpp b/espanso-modulo/src/sys/search/search.cpp
index 6d4ac54e..c3a65807 100644
--- a/espanso-modulo/src/sys/search/search.cpp
+++ b/espanso-modulo/src/sys/search/search.cpp
@@ -37,7 +37,7 @@ const long DEFAULT_STYLE = wxSTAY_ON_TOP | wxFRAME_TOOL_WINDOW;
 #endif
 #ifdef __WXOSX__
 const int SEARCH_BAR_FONT_SIZE = 20;
-const long DEFAULT_STYLE = wxSTAY_ON_TOP | wxFRAME_TOOL_WINDOW | wxRESIZE_BORDER;
+const long DEFAULT_STYLE = wxSTAY_ON_TOP | wxRESIZE_BORDER;
 #endif
 #ifdef __LINUX__
 const int SEARCH_BAR_FONT_SIZE = 20;
@@ -87,7 +87,7 @@ class ResultListBox : public wxHtmlListBox
     // change the appearance by overriding these functions (this is optional)
     virtual void OnDrawBackground(wxDC &dc, const wxRect &rect, size_t n) const;
 
-    bool isDark;
+    bool isDark = false;
 
 public:
     wxDECLARE_NO_COPY_CLASS(ResultListBox);
@@ -137,11 +137,11 @@ class SearchFrame : public wxFrame
 public:
     SearchFrame(const wxString &title, const wxPoint &pos, const wxSize &size);
 
-    wxPanel *panel;
-    wxTextCtrl *searchBar;
-    wxStaticBitmap *iconPanel;
-    wxStaticText *helpText;
-    ResultListBox *resultBox;
+    wxPanel *panel = nullptr;
+    wxTextCtrl *searchBar = nullptr;
+    wxStaticBitmap *iconPanel = nullptr;
+    wxStaticText *helpText = nullptr;
+    ResultListBox *resultBox = nullptr;
     void SetItems(SearchItem *items, int itemSize);
 
 private:
diff --git a/espanso-package/Cargo.toml b/espanso-package/Cargo.toml
index fe5d29d8..01ca9b67 100644
--- a/espanso-package/Cargo.toml
+++ b/espanso-package/Cargo.toml
@@ -15,7 +15,7 @@ tempdir = "0.3.7"
 glob = "0.3.0"
 natord = "1.0.9"
 lazy_static = "1.4.0"
-regex = "1.4.3"
+regex = "1.5.5"
 zip = "0.5.13"
 scopeguard = "1.1.0"
 fs_extra = "1.2.0"
diff --git a/espanso-render/Cargo.toml b/espanso-render/Cargo.toml
index 2244e8a2..5711af66 100644
--- a/espanso-render/Cargo.toml
+++ b/espanso-render/Cargo.toml
@@ -8,7 +8,7 @@ edition = "2018"
 log = "0.4.14"
 anyhow = "1.0.38"
 thiserror = "1.0.23"
-regex = "1.4.3"
+regex = "1.5.5"
 lazy_static = "1.4.0"
 chrono = {version = "0.4.19", features=["unstable-locales"]}
 enum-as-inner = "0.3.3"
diff --git a/espanso/Cargo.toml b/espanso/Cargo.toml
index 03f45334..dbf5278f 100644
--- a/espanso/Cargo.toml
+++ b/espanso/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "espanso"
-version = "2.1.7-beta"
+version = "2.1.8"
 authors = ["Federico Terzi <federicoterzi96@gmail.com>"]
 license = "GPL-3.0"
 description = "Cross-platform Text Expander written in Rust"
@@ -80,7 +80,7 @@ espanso-mac-utils = { path = "../espanso-mac-utils" }
 [target.'cfg(target_os="linux")'.dependencies]
 caps = "0.5.2"
 const_format = "0.2.14"
-regex = "1.4.3"
+regex = "1.5.5"
 
 [package.metadata.deb]
 maintainer = "Federico Terzi <federicoterzi96@gmail.com>"
diff --git a/snapcraft.yaml b/snapcraft.yaml
index a66fc40d..3a3ece22 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -1,5 +1,5 @@
 name: espanso
-version: 2.1.7-beta
+version: 2.1.8
 summary: A Cross-platform Text Expander written in Rust
 description: |
   espanso is a Cross-platform, Text Expander written in Rust.


Test patch: