about summary refs log tree commit diff
path: root/pkgs/applications/office
diff options
context:
space:
mode:
authorOrivej Desh <orivej@gmx.fr>2017-11-16 11:33:39 +0000
committerOrivej Desh <orivej@gmx.fr>2017-11-16 11:37:37 +0000
commit8a325c4dff5022c0ad3920818210d1c1ad955e72 (patch)
tree91ac6fe5d451fcafdb5c3940060730c4a2ec3f15 /pkgs/applications/office
parente1a797e37f61e1df0f316e33cd4501fe0e1df2be (diff)
downloadnixlib-8a325c4dff5022c0ad3920818210d1c1ad955e72.tar
nixlib-8a325c4dff5022c0ad3920818210d1c1ad955e72.tar.gz
nixlib-8a325c4dff5022c0ad3920818210d1c1ad955e72.tar.bz2
nixlib-8a325c4dff5022c0ad3920818210d1c1ad955e72.tar.lz
nixlib-8a325c4dff5022c0ad3920818210d1c1ad955e72.tar.xz
nixlib-8a325c4dff5022c0ad3920818210d1c1ad955e72.tar.zst
nixlib-8a325c4dff5022c0ad3920818210d1c1ad955e72.zip
zotero: add desktop entry
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r--pkgs/applications/office/zotero/default.nix38
1 files changed, 28 insertions, 10 deletions
diff --git a/pkgs/applications/office/zotero/default.nix b/pkgs/applications/office/zotero/default.nix
index 4d66d3dd349a..b259623bf91e 100644
--- a/pkgs/applications/office/zotero/default.nix
+++ b/pkgs/applications/office/zotero/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, buildFHSUserEnv, writeTextFile, bash, wrapGAppsHook, gsettings_desktop_schemas, gtk3, gnome3 }:
+{ stdenv, fetchurl, buildFHSUserEnv, makeDesktopItem, runCommand, bash, wrapGAppsHook, gsettings_desktop_schemas, gtk3, gnome3 }:
 
 let
 version = "5.0.25";
@@ -37,12 +37,30 @@ fhsEnv = buildFHSUserEnv {
   ];
 };
 
-in writeTextFile {
-  name = "zotero";
-  destination = "/bin/zotero";
-  executable = true;
-  text = ''
-    #!${bash}/bin/bash
-    ${fhsEnv}/bin/zotero-fhs-env ${zoteroSrc}/bin/zotero
-  '';
-} // {inherit meta; }
+desktopItem = makeDesktopItem rec {
+  name = "zotero-${version}";
+  exec = "zotero -url %U";
+  icon = "zotero";
+  type = "Application";
+  comment = meta.description;
+  desktopName = "Zotero";
+  genericName = "Reference Management";
+  categories = "Office;Database;";
+  startupNotify = "true";
+};
+
+in runCommand "zotero-${version}" { inherit meta; } ''
+  mkdir -p $out/bin $out/share/applications
+  cat >$out/bin/zotero <<EOF
+#!${bash}/bin/bash
+${fhsEnv}/bin/zotero-fhs-env ${zoteroSrc}/bin/zotero
+EOF
+  chmod +x $out/bin/zotero
+
+  cp ${desktopItem}/share/applications/* $out/share/applications/
+
+  for size in 16 32 48 256; do
+    install -Dm444 ${zoteroSrc}/data/chrome/icons/default/default$size.png \
+      $out/share/icons/hicolor/''${size}x''${size}/apps/zotero.png
+  done
+''