NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.15k stars 13.42k forks source link

nm-applet: not working in taffybar #43836

Open colonelpanic8 opened 6 years ago

colonelpanic8 commented 6 years ago

Issue description

nm-applet icons no longer seem to be available in the hicolor theme. This makes it so that its appindicator no longer works.

❯ nix-shell -p nix-info --run "nix-info -m" bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) /nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

colonelpanic8 commented 6 years ago

This seems to have resolved itself with recompilation, but I'm not really sure how.

colonelpanic8 commented 6 years ago

The issue seems to be that the icon will not appear unless the gnome3 is installed and set to be enabled. Does anyone have any idea why this might be happening?

colonelpanic8 commented 6 years ago

Ahh so I suspect that it might be that it is:

 services.udev.packages = [ pkgs.gnome3.gnome-settings-daemon ];

that makes the difference.

benley commented 6 years ago

@IvanMalison I've tried adding gnome3.gnome-settings-daemon to services.udev.packages as you suggested, and it unfortunately does not fix the problem for me. Do you have any theories as to why that should work?

colonelpanic8 commented 6 years ago

@benley gnome-settings-daemon can provide certain meta data that is needed to get information.

What I DEFINITELY know works is:

https://github.com/IvanMalison/dotfiles/blob/0123b6a5d15e9fc4984cb2089faeb6a21e463856/nixos/configuration.nix#L231

But I'm not exactly sure why that is.

colonelpanic8 commented 6 years ago

This option enables a bunch of services here:

https://github.com/nixos/nixpkgs/blob/ec1082c58fec2f0739855d4dc01df6fdd335e0a3/nixos/modules/services/x11/desktop-managers/gnome3.nix#L92

That's probably a good place to start if you want to avoid enabling all of gnome.

colonelpanic8 commented 6 years ago

Seems to also trigger this:

https://github.com/nixos/nixpkgs/blob/ec1082c58fec2f0739855d4dc01df6fdd335e0a3/nixos/modules/services/x11/display-managers/default.nix#L169

which could be related

benley commented 6 years ago

Found a solution: Some combination of desktopManager.gnome3.enable = true, plus making sure that I start an instance of status-notifier-watcher before taffybar goes looking for it. I was trying to start taffybar and the sni watcher daemon as systemd user units, and despite my best efforts they were coming up in the wrong order.

colonelpanic8 commented 6 years ago

plus making sure that I start an instance of status-notifier-watcher before taffybar goes looking for it.

@benley ahh yes, This is something I do as well using systemd.

It turns out that in some cases you also need to make sure that you only start things that are going to generate icons AFTER taffybar has started, because they will only register their icons if it is determined that a host is in fact present.

colonelpanic8 commented 6 years ago

@benley So just to clarify, you weren't able to find a way to make nm-applet work that doesn't involve completely enabling gnome3?

I'm pretty sure that there should be a way to make this work, and it likely involves just figuring out which of the configuration changes that take place when this is enabled makes this work.

benley commented 6 years ago

I'm sure it doesn't require all of gnome3, but I haven't spent more time tracking it down after I managed to get it working.

purefn commented 5 years ago

@benley @IvanMalison I was running into this same issue. I was able to resolve it by making sure that both the hicolor-icon-theme and gnome-icon-theme were installed in my user nix environment.

colonelpanic8 commented 5 years ago

@purefn All that is needed is gnome-icon-theme? Wow can't believe that is it. I wonder what it is about nm-applet that seems to depend on gnome-icon-theme.

dmvianna commented 5 years ago

@IvanMalison, a mention in taffybar's documentation would save nixos users a lot of time. :)

colonelpanic8 commented 5 years ago

@dmvianna Yes, good point. I'll try to add this. In the meantime, a pull request would be welcome!

dmvianna commented 5 years ago

I could comment the example taffybar.hs as soon as I decipher what each expression means. ewmh in xmonad.hs.example was by far the most surprising thing. What do you mean by “logger information”? It gave me dock icons! XD

-- Daniel Vianna

On 14 Dec 2018, at 5:39 am, Ivan Malison notifications@github.com wrote:

@dmvianna Yes, good point. I'll try to add this. In the meantime, a pull request would be welcome!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

colonelpanic8 commented 5 years ago

I could comment the example taffybar.hs as soon as I decipher what each expression means. ewmh in xmonad.hs.example was by far the most surprising thing.

The best thing to do is just to add an entry to the (soon to be created) FAQ.

What do you mean by “logger information”? It gave me dock icons! XD Oh that comment is outdated. I think the code changed but maybe the comment didn't.

EWMH allows taffybar to learn things about the state of the window manager.

colonelpanic8 commented 4 years ago

A lot of people are running in to this, and I would not say its really resolved. There should be some way to have nm applet enable the appropriate things.

stale[bot] commented 3 years ago

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

afreakk commented 2 years ago

I still dont get nm-applet icon in taffybar, even when importing all these workarounds:

{ config, lib, pkgs, ... }:
{
  # Workaround https://github.com/taffybar/taffybar/issues/403
  # 1. Causes GDK_PIXBUF_MODULE_FILE to be set in xsession.
  services.xserver.gdk-pixbuf.modulePackages = [ pkgs.librsvg ];
  # 2. Generates caches for install icons
  gtk.iconCache.enable = true;
  services.udev.packages = [ pkgs.gnome3.gnome-settings-daemon ];

  # https://github.com/NixOS/nixpkgs/issues/43836#issuecomment-419217138
  environment.systemPackages = with pkgs; [
    hicolor-icon-theme
    gnome-icon-theme
  ];
}

and the following in home.nix:

  services = {
    taffybar.enable = true;
    status-notifier-watcher.enable = true;
}
colonelpanic8 commented 2 years ago

@afreakk are you using the flag that enables sni?