kando-menu / kando

🥧 The Cross-Platform Pie Menu.
https://kando.menu
Other
3.16k stars 89 forks source link

Kwin version check fails on NixOS #537

Closed Hex-4 closed 4 weeks ago

Hex-4 commented 4 months ago

Short Summary

Kando fails to start on NixOS Plasma 6 (wayland) with the error Kando failed to start: Command failed: kwin_wayland --version, but kwin_wayland --version works

Steps to Reproduce the Issue

  1. Add the Kando 1.2.0 AppImage to your home-manager configuration with
    (pkgs.appimageTools.wrapType2 { # or wrapType1
      name = "kando";
      src = pkgs.fetchurl {
        url = "https://github.com/kando-menu/kando/releases/download/v1.2.0/Kando-1.2.0-x86_64.AppImage";
        hash = "sha256-kaxl9ffnOcjfONmI+lNt+NUkaD2N4wMfo/s72T7yL/M=";
      };
      extraPkgs = pkgs: with pkgs; [ ];
    })
  2. Rebuild system
  3. Run Kando with kando

Kando Version

1.2.0

Installation Method

Another method (specify in the comments below)

Desktop Environment

KDE on Wayland

Environment Version

KDE Plasma 6.1 on NixOS unstable (24.11)

Additional Information

Installed by adding AppImage to home-manager config. When I run the portable executable with steam-run ./kando after unzipping I get the same error. Possibly related to #359.

Schneegans commented 4 months ago

On my Arch-based EndeavorOS, this executable is located in /usr/bin. Is that the same for you?

@ivan-hc @Samueru-sama Sorry to ping you, but are you aware of any reason why an app in an AppImage may not be able to call a binary which is available in the outer shell? Can this be some $PATH issues? Or is there anything else going on which could cause this?

ivan-hc commented 4 months ago

@Hex-4 try to run kando like this

GDK_BACKEND=x11 kando
Zetaphor commented 4 months ago

On my Arch-based EndeavorOS, this executable is located in /usr/bin. Is that the same for you?

NixOS does not use the FHS standard:

which kwin_wayland /run/wrappers/bin/kwin_wayland

Hex-4 commented 4 months ago

try to run kando like this:

Same error.

$ GDK_BACKEND=x11 kando
Running on Linux (KDE on wayland).
Loading settings from /home/hexatron/.config/kando/config.json
Loading settings from /home/hexatron/.config/kando/menus.json
Kando failed to start: Command failed: kwin_wayland --version
failed to inherit capabilities: Operation not permitted
Zetaphor commented 4 months ago

@Hex-4 Maybe try with buldFHSEnv in your package script?

Hex-4 commented 4 months ago

I think wrapType2 does that already.

https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-appimageTools

Samueru-sama commented 4 months ago

Do you have this issue when running other electron appimages in nix?

Hex-4 commented 4 months ago

The Obsidian (which uses Electron) AppImage runs just fine.

Samueru-sama commented 4 months ago

The Obsidian AppRun contains this line:

export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}"

And in that location the following libraries were added:

libappindicator.so.1
libgconf-2.so.4
libindicator.so.7
libnotify.so.4
libXss.so.1
libXtst.so.6

Can you try this appimage in nix? that one doesn't contain said libraries.

Hex-4 commented 4 months ago

That one works.

Schneegans commented 4 months ago

Can it be that /run/wrappers/bin is not in the search path when Kando is run from the AppImage?

KingKrouch commented 3 months ago

It looks like another place that kwin_wayland is located in is /run/current-system/sw/bin/kwin_wayland

Schneegans commented 3 months ago

Well, maybe /run/current-system/sw/bin/ or /run/wrappers/bin needs to be added to the PATH? Could anybody try to build the appimage on NixOS and modify the script before so that the paths are added to the PATH before running Kando?

I guess that an export PATH=$PATH:/run/current-system/sw/bin/:/run/wrappers/bin before this line could be sufficient.

git clone https://github.com/kando-menu/kando.git
cd kando
npm install
npm run package
tools/make-app-image.sh

The app image should then be in out/make/appimage.

KingKrouch commented 3 months ago

Well, maybe /run/current-system/sw/bin/ or /run/wrappers/bin needs to be added to the PATH? Could anybody try to build the appimage on NixOS and modify the script before so that the paths are added to the PATH before running Kando?

I guess that an export PATH=$PATH:/run/current-system/sw/bin/:/run/wrappers/bin before this line could be sufficient.

git clone https://github.com/kando-menu/kando.git
cd kando
npm install
npm run package
tools/make-app-image.sh

The app image should then be in out/make/appimage.

I tried that while attempting to compile the application in a Fedora distrobox (Because Nix doesn't use traditional building methods for packages, and there's already a ticket saying that compiling it on Nix itself is challenging), and I didn't have much success building the package.

There's a issue ticket on Nixpkgs here.

I tried running the path command before running the regular AppImage in the releases section, and it still results in the same thing happening.

Schneegans commented 4 weeks ago

Kando is now available as a Nix package: https://search.nixos.org/packages?channel=unstable&show=kando

Does this work for you?

Hex-4 commented 4 weeks ago

Yep, it works! Looks like the package does some dependency patching and builds directly from source.

Thanks for the help!