Proper icon when using makeDesktopItem

Hi there,

I came accross this snippet while surfing GitHub.

{ config, pkgs, ... }: {
  home.packages = with pkgs;
      teams-chromium = makeDesktopItem {
        name = "Teams";
        desktopName = "Teams";
        genericName = "Microsoft Teams";
        exec = ''
          ${config.programs.chromium.package}/bin/chromium --ozone-platform-hint=auto --force-dark-mode --enable-features=WebUIDarkMode --app=""'';
        icon = "teams";
        categories = [ "Network" "InstantMessaging" ];
        mimeTypes = [ "x-scheme-handler/teams" ];
    in [ teams-chromium ];

this works great, But what if not working is the icon. I know it has to do with the class, etc. but I cannot get it working. Any tips? Right now it using my chromium icon.

Thank you.

ok, so I could never “set” the wm_class, however if create a desktop file with something like:

[Desktop Entry]
Name=Nixpkgs Search
Comment=Launch Nixpkgs Search
Exec=chromium --ozone-platform-hint=auto --force-dark-mode --enable-features=WebUIDarkMode  --app="" %U

This would work. Since I could not set the wmclass, I had to see that they were running as and set the StartupWMClass in the desktop file match.

SInce I am on wayland I use LookingGlass (Gnome) to get the wmclass (rebuilt without the StartupWMClass being set, ran - then observed).

The most annoying thing is that you cannot copy the classname. And they can be funky.