about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/kde/kate.nix10
-rw-r--r--pkgs/applications/kde/konqueror.nix10
-rw-r--r--pkgs/applications/kde/okular.nix9
3 files changed, 28 insertions, 1 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
diff --git a/pkgs/applications/kde/konqueror.nix b/pkgs/applications/kde/konqueror.nix
index e6442fea2f9dc..62ed3db063ea2 100644
--- a/pkgs/applications/kde/konqueror.nix
+++ b/pkgs/applications/kde/konqueror.nix
@@ -12,9 +12,17 @@ mkDerivation {
     kdelibs4support kcmutils khtml kdesu
     qtwebkit qtwebengine qtx11extras qtscript qtwayland
   ];
+
+  # InitialPreference values are too high and any text/html ends up
+  # opening konqueror, even if firefox or chromium are also available.
+  # Resetting to 1, which is the default.
+  postPatch = ''
+    substituteInPlace kfmclient_html.desktop \
+      --replace InitialPreference=9 InitialPreference=1
+  '';
+
   meta = {
     license = with lib.licenses; [ gpl2 ];
     maintainers = with lib.maintainers; [ ];
   };
 }
-
diff --git a/pkgs/applications/kde/okular.nix b/pkgs/applications/kde/okular.nix
index f07df73a25564..3bcdb9ca84244 100644
--- a/pkgs/applications/kde/okular.nix
+++ b/pkgs/applications/kde/okular.nix
@@ -18,6 +18,15 @@ mkDerivation {
     kwindowsystem libkexiv2 libspectre libzip phonon poppler qca-qt5
     qtdeclarative qtsvg threadweaver kcrash
   ] ++ lib.optional (!stdenv.isAarch64) chmlib;
+
+  # InitialPreference values are too high and end up making okular
+  # default for anything considered text/plain. Resetting to 1, which
+  # is the default.
+  postPatch = ''
+    substituteInPlace generators/txt/okularApplication_txt.desktop \
+      --replace InitialPreference=3 InitialPreference=1
+  '';
+
   meta = with lib; {
     homepage = "http://www.kde.org";
     license = with licenses; [ gpl2 lgpl21 fdl12 bsd3 ];