about summary refs log tree commit diff
path: root/pkgs/applications/kde/kate.nix
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2020-04-27 16:39:11 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2020-04-27 23:00:25 -0500
commitb3f812688c6c30a2a02f6047523ef51afb40df7d (patch)
tree5baae99ed2c1776b0b71e7a9dc818d3f14df0f01 /pkgs/applications/kde/kate.nix
parent5e6adf78e9644e24ca494c3ba64400e5eea5bd1d (diff)
kde/{kate,konqueror,okular}: decrease text mimetype preference
These .desktop files set InitialPreference>1 which will override other
associations even the .desktop appears first in XDG_DATA_DIRS. This
applies to:

- org.kde.kate.desktop
- org.kde.kwrite.desktop
- kfmclient_html.desktop
- okularApplication_txt.desktop

Fixes #86137
Diffstat (limited to 'pkgs/applications/kde/kate.nix')
-rw-r--r--pkgs/applications/kde/kate.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/applications/kde/kate.nix b/pkgs/applications/kde/kate.nix
index f01a57a55d4dd..e0d0273efde19 100644
--- a/pkgs/applications/kde/kate.nix
+++ b/pkgs/applications/kde/kate.nix
@@ -14,6 +14,16 @@ mkDerivation {
     maintainers = [ lib.maintainers.ttuegel ];
   };
 
+  # InitialPreference values are too high and end up making kate &
+  # kwrite defaults for anything considered text/plain. Resetting to
+  # 1, which is the default.
+  postPatch = ''
+    substituteInPlace kate/data/org.kde.kate.desktop \
+      --replace InitialPreference=9 InitialPreference=1
+    substituteInPlace kwrite/data/org.kde.kwrite.desktop \
+      --replace InitialPreference=8 InitialPreference=1
+  '';
+
   nativeBuildInputs = [ extra-cmake-modules kdoctools ];
   buildInputs = [
     libgit2