anyrun-org / anyrun

A wayland native, highly customizable runner.
GNU General Public License v3.0
639 stars 53 forks source link

Symbols library cannot copy to clipboard due to outdated wl-clipboard-rs #180

Open swomf opened 1 month ago

swomf commented 1 month ago

Environment: Hyprland v0.42.0, Arch Linux

When using the symbols plugin, i.e. /etc/anyrun/plugins/libsymbols.so built from plugins/symbols, selecting a Unicode symbol to copy gives the following bug, preventing the clipboard from successfully copying the selected symbol:

$ RUST_BACKTRACE=1 anyrun
Error reading applications plugin config: No such file or directory (os error 2)
Child spawned to serve copy requests.
Received an event primary_selection requiring version >= 2 while proxy zwlr_data_control_device_v1@5 is version 1.
thread 'main' panicked at anyrun/src/main.rs:286:18:
Failed to serve copy bytes: WaylandCommunication(Custom { kind: Other, error: "Dispatch for object zwlr_data_control_device_v1@5 errored." })
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

This is rectifiable with the following patch, which upgrades the version specification of wl-clipboard-rs in anyrun/Cargo.toml:

diff --git a/anyrun/Cargo.toml b/anyrun/Cargo.toml
index 373e380..9debfaf 100644
--- a/anyrun/Cargo.toml
+++ b/anyrun/Cargo.toml
@@ -13,6 +13,6 @@ gtk-layer-shell = { version = "0.5.0", features = ["v0_6"] }
 ron = "0.8.0"
 serde = { version = "1.0.151", features = ["derive"] }
 anyrun-interface = { path = "../anyrun-interface" }
-wl-clipboard-rs = "0.7.0"
+wl-clipboard-rs = "0.8.1"
 nix = { version = "0.26.1", default-features = false, features = ["process"] }
 clap = { version = "4.2.7", features = ["derive"] }
Jappie3 commented 1 day ago

@NotAShelf could we perchance get a cargo update to fix this problem? (or just apply the patch supplied here) if you want me to open a PR for this & handle testing just lmk

NotAShelf commented 1 day ago

I've been meaning to cargo update for a while, but there are some crates that require refactors in the code.

I'll see if I can update wl-clipboard without breaking any plugins.

NotAShelf commented 18 hours ago

https://github.com/anyrun-org/anyrun/pull/190

testing appreciated