From cbc4ee7e10c7bbf5e93773967fab84e253905d45 Mon Sep 17 00:00:00 2001 From: Laverne Schrock Date: Thu, 17 Nov 2016 20:42:01 -0600 Subject: [PATCH] xournal: add desktop file and mime info Fixes #20510. The application now appears in system menus, and Konqueror now suggests opening .xoj files with Xournal. Other file browsers should as well. --- .../applications/graphics/xournal/default.nix | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/graphics/xournal/default.nix b/pkgs/applications/graphics/xournal/default.nix index b81efb08d8ac..669fc5a28a73 100644 --- a/pkgs/applications/graphics/xournal/default.nix +++ b/pkgs/applications/graphics/xournal/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl +{ stdenv, fetchurl, makeDesktopItem , ghostscript, atk, gtk2, glib, fontconfig, freetype , libgnomecanvas, libgnomeprint, libgnomeprintui , pango, libX11, xproto, zlib, poppler @@ -21,6 +21,32 @@ stdenv.mkDerivation rec { NIX_LDFLAGS = [ "-lX11" "-lz" ]; + desktopItem = makeDesktopItem { + name = name; + exec = "xournal"; + icon = "xournal"; + desktopName = "Xournal"; + comment = meta.description; + categories = "Office;Graphics;"; + mimeType = "application/pdf;application/x-xoj"; + genericName = "PDF Editor"; + }; + + postInstall='' + mkdir --parents $out/share/mime/packages + cat << EOF > $out/share/mime/packages/xournal.xml + + + Xournal Document + + + + EOF + cp --recursive ${desktopItem}/share/applications $out/share + mkdir --parents $out/share/icons + cp $out/share/xournal/pixmaps/xournal.png $out/share/icons + ''; + meta = { homepage = http://xournal.sourceforge.net/; description = "Note-taking application (supposes stylus)";