NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.48k stars 12.98k forks source link

Heroic protocol not working #273608

Open TaTsuuYa opened 6 months ago

TaTsuuYa commented 6 months ago

Describe the bug

So basically when I try launching games from the Heroic launcher nothing happens. When I checked the .desktop file, Exec set to: xdg-open heroic://launch/legendary/0a2d9f6403244d12969e11da6713137b. I tried running the command in the console I got:

[tatsuuya@nixos:~]$ xdg-open heroic://launch/legendary/0a2d9f6403244d12969e11da6713137b
gio: heroic://launch/legendary/0a2d9f6403244d12969e11da6713137b: The specified location is not supported

Running xdg-open heroic gives:

[tatsuuya@nixos:~]$ xdg-open heroic
gio: file:///home/tatsuuya/heroic: Error when getting information for file “/home/tatsuuya/heroic”: No such file or directory

Steps To Reproduce

Steps to reproduce the behavior:

  1. Serch for the game
  2. Click on it
  3. Nothing happens

Expected behavior

The game should launch normally.

Additional context

[tatsuuya@nixos:~]$ neofetch 
          ▗▄▄▄       ▗▄▄▄▄    ▄▄▄▖
          ▜███▙       ▜███▙  ▟███▛
           ▜███▙       ▜███▙▟███▛             tatsuuya@nixos 
            ▜███▙       ▜██████▛              -------------- 
     ▟█████████████████▙ ▜████▛     ▟▙        OS: NixOS 23.11.1209.933d7dc15509 (Tapir) x86_64 
    ▟███████████████████▙ ▜███▙    ▟██▙       Host: ASUSTeK COMPUTER INC. GU502LU 
           ▄▄▄▄▖           ▜███▙  ▟███▛       Kernel: 6.1.64 
          ▟███▛             ▜██▛ ▟███▛        Uptime: 2 hours, 6 mins 
         ▟███▛               ▜▛ ▟███▛         Packages: 1502 (nix-system), 1854 (nix-user), 185 (nix-default) 
▟███████████▛                  ▟██████████▙   Shell: bash 5.2.15 
▜██████████▛                  ▟███████████▛   Resolution: 1920x1080 
      ▟███▛ ▟▙               ▟███▛            DE: GNOME 45.1 (Wayland) 
     ▟███▛ ▟██▙             ▟███▛             WM: Mutter 
    ▟███▛  ▜███▙           ▝▀▀▀▀              WM Theme: Adwaita 
    ▜██▛    ▜███▙ ▜██████████████████▛        Theme: Adwaita [GTK2/3] 
     ▜▛     ▟████▙ ▜████████████████▛         Icons: Adwaita [GTK2/3] 
           ▟██████▙       ▜███▙               Terminal: kgx 
          ▟███▛▜███▙       ▜███▙              CPU: Intel i7-10750H (12) @ 5.000GHz 
         ▟███▛  ▜███▙       ▜███▙             GPU: NVIDIA GeForce GTX 1660 Ti Mobile 
         ▝▀▀▀    ▀▀▀▀▘       ▀▀▀▘             GPU: Intel CometLake-H GT2 [UHD Graphics] 
                                              Memory: 5636MiB / 15789MiB

Notify maintainers

@aidalgol

Metadata

[tatsuuya@nixos:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.64, NixOS, 23.11 (Tapir), 23.11.1209.933d7dc15509`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
aidalgol commented 6 months ago

I think there are two parts to this problem.

First, Heroic is using the Electron protocol API to register heroic:// as a protocol for xdg-open to find, and that is failing for some reason.

WARNING: [Backend]:          Failed to register protocol with OS.

Second, Heroic is run inside an FHS environment wrapper (see buildFHSEnv in the Nixpkgs manual), which may be why Electron fails to register the protocol.

I just tried creating a desktop shortcut from Steam to see what that looked like for comparison, and nothing happened, not even a log message, although Steam uses Chromium Embedded Framework, not Electron, so that may not have been of much use anyway.

I might need help from someone more familiar with Electron and buildFHSEnv to figure out exactly why this operation is failing.