summary refs log tree commit diff
path: root/pkgs/misc/drivers
diff options
context:
space:
mode:
authorjopejoe1 <johannes@joens.email>2023-03-20 14:22:44 +0100
committerjopejoe1 <johannes@joens.email>2023-03-20 16:04:21 +0100
commit7cee2ad598c1c4437b6f578cd75722853784d2b1 (patch)
tree9e7d6ec724809509939c8d20dcad8d40140b051f /pkgs/misc/drivers
parentccae7d35d80b28caaa290b402faf7c4a6a43f14a (diff)
hplip: fix broken/hardcoded paths in .desktop files
Diffstat (limited to 'pkgs/misc/drivers')
-rw-r--r--pkgs/misc/drivers/hplip/default.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix
index a300ff2ae6349..3b87a0ac12b1b 100644
--- a/pkgs/misc/drivers/hplip/default.nix
+++ b/pkgs/misc/drivers/hplip/default.nix
@@ -127,6 +127,9 @@ python3Packages.buildPythonApplication {
       -e s,/usr/bin/gs,${ghostscript}/bin/gs,g \
       -e s,/usr/share/cups/fonts,${ghostscript}/share/ghostscript/fonts,g \
       -e "s,ExecStart=/usr/bin/python /usr/bin/hp-config_usb_printer,ExecStart=$out/bin/hp-config_usb_printer,g" \
+      -e s,Exec=/usr/bin/hp-uiscan,Exec=hp-uiscan,g \
+      -e s,Icon=/usr/share/icons/Humanity/devices/48/printer.svg,Icon=printer,g \
+      -e s,Icon=@abs_datadir@/hplip/data/images/128x128/hp_logo.png,Icon=hp_logo,g \
       {} +
 
     echo 'AUTOMAKE_OPTIONS = foreign' >> Makefile.am
@@ -180,7 +183,13 @@ python3Packages.buildPythonApplication {
   # Running `hp-diagnose_plugin -g` can be used to diagnose
   # issues with plugins.
   #
-  postInstall = lib.optionalString withPlugin ''
+  postInstall = ''
+    for resolution in 16x16 32x32 64x64 128x128 256x256; do
+      mkdir -p $out/share/icons/hicolor/$resolution/apps
+      ln -s $out/share/hplip/data/images/$resolution/hp_logo.png \
+        $out/share/icons/hicolor/$resolution/apps/hp_logo.png
+    done
+  '' + lib.optionalString withPlugin ''
     sh ${plugin} --noexec --keep
     cd plugin_tmp