Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neofetch returns the wrong icon theme #108903

Closed
rhoriguchi opened this issue Jan 10, 2021 · 3 comments
Closed

Neofetch returns the wrong icon theme #108903

rhoriguchi opened this issue Jan 10, 2021 · 3 comments
Labels
0.kind: bug Something is broken

Comments

@rhoriguchi
Copy link
Contributor

rhoriguchi commented Jan 10, 2021

Describe the bug
neofetch returns the wrong icon theme.

To Reproduce
Steps to reproduce the behavior:

  1. install non default icon theme as example install pkgs.papirus-icon-theme
  2. set icon theme gsettings set org.gnome.desktop.interface icon-theme 'Papirus'
  3. run neofetch
  4. neofetch shows Icons: Adwaita [GTK2/3]

Expected behavior
Icon theme should show Icons: Papirus [GTK2/3]

Additional context
When I call gsettings in a terminal I get:

> gsettings get org.gnome.desktop.interface icon-theme
'Papirus'

When I append the source from Nixos with:

set -x
get_icons

And I run it, I get on line 3067-3068:

++ gsettings get org.gnome.desktop.interface icon-theme
+ gtk3_theme=''\''Adwaita'\'''
+ gtk2_theme=''\''Adwaita'\'''

I suspect some variable is missing so that the icon theme can be correctly detected.


I've also asked in the Nixos discord group, but I couldn't figure out how to fix it: https://discordapp.com/channels/568306982717751326/570351749848891393/797617960650014720

Notify maintainers
@alistairbill @konimex

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.86, NixOS, 21.03pre262020.f211631c1cb (Okapi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.10`
 - channels(root): `"nixos-21.03pre262020.f211631c1cb, home-manager-20.09"`
 - 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:
- neofetch
@rhoriguchi rhoriguchi added the 0.kind: bug Something is broken label Jan 10, 2021
@rhoriguchi rhoriguchi changed the title neofetch returns the wrong icon theme Neofetch returns the wrong icon theme Jan 19, 2021
@jtojnar
Copy link
Member

jtojnar commented Jan 20, 2021

Any warnings? Since it actually prints a value I would think that it is not missing gsettings-desktop-schemas but GSettings might be using a memory backend instead of dconf backend your session uses? See also https://nixos.org/manual/nixpkgs/stable/#ssec-gnome-settings.

@rhoriguchi
Copy link
Contributor Author

rhoriguchi commented Feb 13, 2021

Any warnings?

No


Sadly I still can't get it to work. D-Bus service is enabled programs.dconf.enable = true

What I've tried:

{ neofetch, dconf }:
neofetch.overrideAttrs (oldAttrs: {
  buildInputs = [ dconf ];
})
{ neofetch, makeWrapper, lib, dconf }:
neofetch.overrideAttrs (oldAttrs: {
  nativeBuildInputs = [ makeWrapper ];

  postInstall = ''
    wrapProgram $out/bin/neofetch \
      --prefix XDG_DATA_DIRS : "$out/share" \
      --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS" \
      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
      --prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules"
  '';
})
{ neofetch, makeWrapper, lib, dconf }:
neofetch.overrideAttrs (oldAttrs: {
  nativeBuildInputs = [ makeWrapper ];

  postInstall = ''
    wrapProgram $out/bin/neofetch \
      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
      --prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules"
  '';
})
{ neofetch, makeWrapper, lib, dconf }:
neofetch.overrideAttrs (oldAttrs: {
  nativeBuildInputs = [ makeWrapper ];

  postInstall = ''
    wrapProgram $out/bin/neofetch \
      --prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules"
  '';
})
{ neofetch, makeWrapper, lib, dconf, gsettings-desktop-schemas }:
neofetch.overrideAttrs (oldAttrs: {
  nativeBuildInputs = [ makeWrapper ];

  postInstall = ''
    wrapProgram $out/bin/neofetch \
      --prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules" \
      --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}
  '';
})

@lilyinstarlight
Copy link
Member

It looks like this is caused by Neofetch overriding the GIO_EXTRA_MODULES environment variable in the code at https://github.com/dylanaraps/neofetch/blob/547acd8d55b2e6b6c5b4f164756dbd336b72c4a4/neofetch#L49. This seems to have been done to fix some issue with gsettings someone else had at dylanaraps/neofetch#949.

I've made a PR upstream to resolve the issue (see dylanaraps/neofetch#1873).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

4 participants