Merge pull request #57037 from matthewbauer/remove-xdg-desktop-menu-dummy

plasma: handle kbuildsycoca5 better
This commit is contained in:
Matthew Bauer 2019-03-11 22:58:40 -04:00 committed by GitHub
commit 7890494813
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 3 deletions

View file

@ -226,7 +226,29 @@ in
security.pam.services.slim.enableKwallet = true;
# Update the start menu for each user that is currently logged in
system.userActivationScripts.plasmaSetup = "${pkgs.libsForQt5.kservice}/bin/kbuildsycoca5";
system.userActivationScripts.plasmaSetup = ''
# The KDE icon cache is supposed to update itself
# automatically, but it uses the timestamp on the icon
# theme directory as a trigger. Since in Nix the
# timestamp is always the same, this doesn't work. So as
# a workaround, nuke the icon cache on login. This isn't
# perfect, since it may require logging out after
# installing new applications to update the cache.
# See http://lists-archives.org/kde-devel/26175-what-when-will-icon-cache-refresh.html
rm -fv $HOME/.cache/icon-cache.kcache
# xdg-desktop-settings generates this empty file but
# it makes kbuildsyscoca5 fail silently. To fix this
# remove that menu if it exists.
rm -fv $HOME/.config/menus/applications-merged/xdg-desktop-menu-dummy.menu
# Remove the kbuildsyscoca5 cache. It will be regenerated
# immediately after. This is necessary for kbuildsyscoca5 to
recognize that software that has been removed.
rm -fv $HOME/.cache/ksycoca*
${pkgs.libsForQt5.kservice}/bin/kbuildsycoca5
'';
})
];

View file

@ -81,7 +81,7 @@ index 714a9bf1..9733c612 100644
fi
# Boot sequence:
@@ -33,61 +42,133 @@ fi
@@ -33,61 +42,142 @@ fi
#
# * Then ksmserver is started which takes control of the rest of the startup sequence
@ -102,6 +102,15 @@ index 714a9bf1..9733c612 100644
+# See http://lists-archives.org/kde-devel/26175-what-when-will-icon-cache-refresh.html
+rm -fv $HOME/.cache/icon-cache.kcache
+
+# xdg-desktop-settings generates this empty file but
+# it makes kbuildsyscoca5 fail silently. To fix this
+# remove that menu if it exists.
+rm -fv $HOME/.config/menus/applications-merged/xdg-desktop-menu-dummy.menu
+
+# Remove the kbuildsyscoca5 cache. It will be regenerated immediately after.
+# This is necessary for kbuildsyscoca5 to recognize that software that has been removed.
+rm -fv $HOME/.cache/ksycoca*
+
+# Qt writes a weird libraryPath line to
+# ~/.config/Trolltech.conf that causes the KDE plugin
+# paths of previous KDE invocations to be searched.
@ -721,7 +730,7 @@ diff --git a/startkde/startplasmacompositor.cmake b/startkde/startplasmacomposit
index dd9e304d..12132f9e 100644
--- a/startkde/startplasmacompositor.cmake
+++ b/startkde/startplasmacompositor.cmake
@@ -1,118 +1,165 @@
@@ -1,118 +1,174 @@
#!/bin/sh
#
-# DEFAULT Plasma STARTUP SCRIPT ( @PROJECT_VERSION@ )
@ -749,6 +758,15 @@ index dd9e304d..12132f9e 100644
+# See http://lists-archives.org/kde-devel/26175-what-when-will-icon-cache-refresh.html
+rm -fv $HOME/.cache/icon-cache.kcache
+
+# xdg-desktop-settings generates this empty file but
+# it makes kbuildsyscoca5 fail silently. To fix this
+# remove that menu if it exists.
+rm -fv $HOME/.config/menus/applications-merged/xdg-desktop-menu-dummy.menu
+
+# Remove the kbuildsyscoca5 cache. It will be regenerated immediately after.
+# This is necessary for kbuildsyscoca5 to recognize that software that has been removed.
+rm -fv $HOME/.cache/ksycoca*
+
+# Qt writes a weird libraryPath line to
+# ~/.config/Trolltech.conf that causes the KDE plugin
+# paths of previous KDE invocations to be searched.