From e3c5f6176877a456148049b7f3fbd79a3e445a31 Mon Sep 17 00:00:00 2001 From: Alex Epelde Date: Sat, 8 Mar 2025 20:36:25 -0500 Subject: [PATCH 1/2] 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}' ''; }; From ccb32eb2dd93497ba409a536e4d387e63198cb38 Mon Sep 17 00:00:00 2001 From: Alex Epelde Date: Sun, 9 Mar 2025 07:43:22 -0400 Subject: [PATCH 2/2] joplin-desktop: specify executable name directly --- pkgs/by-name/jo/joplin-desktop/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/jo/joplin-desktop/package.nix b/pkgs/by-name/jo/joplin-desktop/package.nix index 0b5ac3229259..abf133146e64 100644 --- a/pkgs/by-name/jo/joplin-desktop/package.nix +++ b/pkgs/by-name/jo/joplin-desktop/package.nix @@ -42,7 +42,7 @@ let platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ]; }; - linux = appimageTools.wrapType2 rec { + linux = appimageTools.wrapType2 { inherit pname version src meta; nativeBuildInputs = [ makeWrapper ]; @@ -51,12 +51,12 @@ let ''; extraInstallCommands = '' - wrapProgram $out/bin/${pname} \ + wrapProgram $out/bin/joplin-desktop \ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" 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}' + --replace-fail 'Exec=AppRun' 'Exec=joplin-desktop' ''; };