anyrun icon indicating copy to clipboard operation
anyrun copied to clipboard

bug: randr plugin (and anyrun as a whole) panics on Hyprland 0.40.0

Open peppidesu opened this issue 1 year ago • 5 comments

Steps to reproduce:

  • install and run Hyprland >0.40.0
  • open anyrun

Expected behavior:

  • anyrun opens without issues

Actual behavior:

  • anyrun panics:
    thread '<unnamed>' panicked at 'A error occured while parsing the output from the hypr socket: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })', /home/peppidesu/.cargo/registry/src/github.com-1ecc6299db9ec823/hyprland-0.3.9/src/data/regular.rs:31:19
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', plugins/randr/src/lib.rs:106:1
    thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Any { .. }', plugins/randr/src/lib.rs:37:1
    
    file:plugins/randr/src/lib.rs
    line:37
    Attempted to panic across the ffi boundary.
    Aborting to handle the panic...
    

Reason: Hyprland has moved the hyprland socket from /tmp/hypr to $XDG_RUNTIME_DIR in 0.40.0. This change has been merged into hyprland-rs:master and is included in version 0.4.0-alpha.1, but is not yet included in the latest stable release.

Solution: Either:

  • wait for the next release of hyprland-rs, and change the package version in plugins/randr/Cargo.toml.
  • temporarily use the alpha release of hyprland-rs
    hyprland = "0.4.0-alpha.1"
    

peppidesu avatar May 12 '24 11:05 peppidesu

This didn't fix issues on current Arch, I wouldn't be too fast with this.

dbischof90 avatar May 27 '24 09:05 dbischof90

As a workaround you can symlink it to the expected location.

Lord-Valen avatar May 28 '24 16:05 Lord-Valen

As a workaround you can symlink it to the expected location.

@Lord-Valen this would need to be done on every boot, though.

peppidesu avatar Jul 07 '24 15:07 peppidesu

As a workaround you can symlink it to the expected location.

@Lord-Valen this would need to be done on every boot, though.

Yes. Better than not working at all!

Lord-Valen avatar Jul 07 '24 18:07 Lord-Valen

hyprland-rs has not yet put out a stable release with the relevant changes. For people reading this right now, you can do one of the following:

  • At startup, symlink $XDG_RUNTIME_DIR/hypr to /tmp/hypr:
    ln -s $XDG_RUNTIME_DIR/hypr /tmp/hypr
    
  • (Arch): Modify the PKGBUILD
    1. remove the --frozen flag from cargo build on line 31
    2. add the following at the end of prepare():
    sed -i 's/hyprland = "0.3"/hyprland = "0.4.0-alpha.2"/g' plugins/randr/Cargo.toml
    
    then run makepkg -si as per usual.

peppidesu avatar Aug 04 '24 14:08 peppidesu