NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.95k stars 13.97k forks source link

can't launch discord from rofi #124965

Open skandix opened 3 years ago

skandix commented 3 years ago

Describe the bug After the new version from Discord (0.0.15) i'm not able to launch discord from rofi, as its just chrasing

To Reproduce

  1. rofi -show run
  2. Pick Discord in the list
  3. Starting to start, and Crashing.

Expected behavior It should spawn discord as normal, and not crash

Screenshots If applicable, add screenshots to help explain your problem. discord_not_spawning

Additional context Add any other context about the problem here.

Notify maintainers

Metadata Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.119, NixOS, 20.09.4204.76ed24ceab9 (Nightingale)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.11`
 - channels(skandix): `"home-manager-20.09, nixos-hardware"`
 - channels(root): `"home-manager-20.09, nixos-20.09.4204.76ed24ceab9, nixos-hardware"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
SCOTT-HAMILTON commented 3 years ago

Your discord seems to be missing libpng, could you give the output of this command :

$ ldd "$(readlink -f $(which Discord)|rev|cut -d/ -f2-|rev)/.Discord-wrapped"

We should also verify that this file is indeed a png file :

$ file /run/current-system/sw/share/icons/Adwaita/16x16/status/image-missing.png
skandix commented 3 years ago
futile commented 3 years ago

Does this only happen with rofi? Or also if you, e.g., launch discord from a terminal?

Found these issues that look similar, might or might not be related:

skandix commented 3 years ago

It only happens through rofi, works fine when launching it through the terminal. it's after the latest discord update this started to happen, never had this kind of error with rofi from before.

-r--r--r-- 7 root root 565 Jan 1 1970 /run/current-system/sw/share/icons/Adwaita/16x16/status/image-missing.png

futile commented 3 years ago
$ ls -al /run/current-system/sw/share/icons/Adwaita/16x16/status/image-missing.png 
-r--r--r-- 1 root root 565 Jan  1  1970 /run/current-system/sw/share/icons/Adwaita/16x16/status/image-missing.png
$ ls -al $(realpath /run/current-system/sw/share/icons/Adwaita/16x16/status/image-missing.png)
-r--r--r-- 1 root root 565 Jan  1  1970 /nix/store/56cx3n870044hwsxa08xa2a9q9zqzaw5-adwaita-icon-theme-3.36.1/share/icons/Adwaita/16x16/status/image-missing.png

That seems to be the same on my system, and I just did a nix run nixpkgs/nixos-20.09#rofi --show run and started discord, which also worked fine.

SCOTT-HAMILTON commented 3 years ago

Have you figured out wether this was due to a recent rofi update or a discord update ? And if so which update introduced this issue.

Omoroca13 commented 3 years ago

I think the reason for this is #110805 I have something similar with steam were the tray icon shows only the unknown icon instead of the steam icon.

shot-1623312324

if I try with nix-shell -p rofi -I nixpkgs=channel:nixos-20.09

shot-1623312545

it works

so its probably something with wrapping rofi with gdk-pixbuff

no clue how to fix this though

wchresta commented 3 years ago

Ran into this same issue on Ubuntu + nix (I can't run any gtk applications through rofi that have not been installed through nix). The problem for me is that rofi sets $GDK_PIXBUF_MODULE_FILE for all started programs instead of just the ones coming through nix. This makes other locally installed progams use the loaders.cache in nix-store instead of my system loaders.cache. My dirty fix is to use overrideAttrs to get a rofi derivation without gdk-pixbuf in buildInputs:

pkgs.rofi.overrideAttrs (oldAttrs: rec {                                                                         
  buildInputs = builtins.filter (x: x.pname != "gdk-pixbuf") oldAttrs.buildInputs;                                         
} )

This removes export GDK_PIXBUF_MODULE_FILE from rofi wrapper and everything works again (for me).

rvalieris commented 3 years ago

same issue here launching firefox/chromium (from ubuntu) with rofi (from nixpkgs) makes the browser crash when I try to open a file picker. @wchresta workaround solves the issue.

stale[bot] commented 2 years ago

I marked this as stale due to inactivity. → More info