Obsidian reports Wayland app_id as "electron" instead of "obsidian"

Steps to reproduce

Problem

On Wayland (Linux), Obsidian’s window reports its app_id as “electron” instead of “obsidian”. This breaks icon resolution in desktop shells and taskbars (e.g. noctalia-shell, waybar) because they can’t match the window to Obsidian’s .desktop entry.

Root Cause

Obsidian’s package.json is missing the desktopName field. Electron uses this field to set the Wayland app_id via xdg_toplevel_set_app_id. Without it, Electron falls back to the binary name, which on distributions like NixOS is “electron” (since apps share a system Electron binary).

Signal Desktop doesn’t have this problem because it sets “desktopName”: “signal.desktop” in its package.json, causing Electron to correctly report app_id: “signal”.

Suggested fix

Add to package.json: “desktopName”: “obsidian.desktop”.

Current workaround

I’m adding StartupWMClass=electron to Obsidian’s .desktop entry so the desktop shell can
match the “electron” app_id back to Obsidian. This is not ideal because:

- It’s fragile – if any other Electron app also reports as “electron”, they’ll conflict.

- It requires distribution-level patching (e.g. NixOS overrideAttrs) that every packager
has to do independently

- The app_id should be “obsidian”, not “electron” – the workaround just papers over the
mismatch

Did you follow the troubleshooting guide? [Y/N]

Yes. I have temporary fix for it.

Expected result

Icon should be visible for the window in the noctalia-shell.

Actual result

Generic icon is shown instead of the Obsidian icon.

Environment

NixOS, niri (Wayland), and noctalia-shell.


Additional information

N/A.

This beyond what we support. We only officially support KDE or Gnome.

Also, How did you install Obsidian? Did you use our appimage or snap?

ok, I re-read your BR. we don’t support this.
This is an unsupported (and unauthorized) third party package. Sorry.

(post deleted by author)

I will try to get this resolved on Nix’s end. The AppImage seems to work correctly.

I made a flake for the recent AppImage. Works fine now, and I don’t need a workaround.

{
description = “Obsidian - AppImage package”;

inputs = {
nixpkgs.url = “github:nixos/nixpkgs/nixos-unstable”;
};

outputs = { self, nixpkgs }: let
system = “x86_64-linux”;
pkgs = nixpkgs.legacyPackages.${system};

pname = "obsidian";
version = "1.12.7";

src = pkgs.fetchurl {
  url = "https://github.com/obsidianmd/obsidian-releases/releases/download/v${version}/Obsidian-${version}.AppImage";
  hash = "sha256-9ti5b+aFqGMsgZzAk6JIrOD2urQQ9EpskpomEbHrsXw=";
};

icon = pkgs.fetchurl {
  url = "https://obsidian.md/images/obsidian-logo-gradient.svg";
  hash = "sha256-EZsBuWyZ9zYJh0LDKfRAMTtnY70q6iLK/ggXlplDEoA=";
};

desktopItem = pkgs.makeDesktopItem {
  name = "obsidian";
  desktopName = "Obsidian";
  comment = "Knowledge base";
  icon = "obsidian";
  exec = "obsidian %u";
  categories = [ "Office" ];
  mimeTypes = [ "x-scheme-handler/obsidian" ];
  startupWMClass = "obsidian";
};

appimageContents = pkgs.appimageTools.extract {
  inherit pname version src;
};

obsidian = pkgs.appimageTools.wrapType2 {
  inherit pname version src;

  extraInstallCommands = ''
    install -m 444 -D "${desktopItem}/share/applications/"* \
      -t $out/share/applications/

    for size in 16 24 32 48 64 128 256 512; do
      mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
      ${pkgs.imagemagick}/bin/magick -background none ${icon} -resize "$size"x"$size" \
        $out/share/icons/hicolor/"$size"x"$size"/apps/obsidian.png
    done
  '';
};

in {
packages.${system} = {
obsidian = obsidian;
default = obsidian;
};
};
}