From e3c5f6176877a456148049b7f3fbd79a3e445a31 Mon Sep 17 00:00:00 2001 From: Alex Epelde Date: Sat, 8 Mar 2025 20:36:25 -0500 Subject: [PATCH] joplin-desktop: XDG compliant desktop entry Two minor changes related to the desktop entry shipped with the package: - Use `joplin.desktop`, an [XDG compliant][1] filename. As things stand, there are issues when using, for example, `uwsm app {path to desktop entry}` to launch Joplin [[2]]. - Install the application icon at `$out/share/pixmaps/joplin.png` and keep the `Icon=joplin` line in the desktop entry. Users of icon themes are then more likely to get the Joplin icon shipped by their icon theme to show up. [1]:https://specifications.freedesktop.org/desktop-entry-spec/latest/file-naming.html [2]:https://github.com/Vladimir-csp/uwsm/blob/master/uwsm/main.py#L204 --- pkgs/by-name/jo/joplin-desktop/package.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/jo/joplin-desktop/package.nix b/pkgs/by-name/jo/joplin-desktop/package.nix index b8b46c977184..0b5ac3229259 100644 --- a/pkgs/by-name/jo/joplin-desktop/package.nix +++ b/pkgs/by-name/jo/joplin-desktop/package.nix @@ -53,11 +53,10 @@ let extraInstallCommands = '' wrapProgram $out/bin/${pname} \ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" - install -Dm444 ${appimageContents}/@joplinapp-desktop.desktop -t $out/share/applications - install -Dm444 ${appimageContents}/@joplinapp-desktop.png -t $out/share/pixmaps - substituteInPlace $out/share/applications/@joplinapp-desktop.desktop \ - --replace 'Exec=AppRun' 'Exec=${pname}' \ - --replace 'Icon=joplin' "Icon=@joplinapp-desktop" + install -Dm644 ${appimageContents}/@joplinapp-desktop.desktop $out/share/applications/joplin.desktop + install -Dm644 ${appimageContents}/@joplinapp-desktop.png $out/share/pixmaps/joplin.png + substituteInPlace $out/share/applications/joplin.desktop \ + --replace-fail 'Exec=AppRun' 'Exec=${pname}' ''; };