Skip to content

egnrse/updateKDEcache.hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

updateKDEcache.hook

A pacman hook to update the kService system configuration cache automatically.

This is intendet for KDE apps like Dolphin running outside of Plasma, that rely on the kService desktop file configuration cache on Arch Linux.

Usage

Install the following dependecies:
pacman -S coreutils archlinux-xdg-menu kservice sudo

Put the file updateKDEcache.hook into /etc/pacman.d/hooks/updateKDEcache.hook
For Security reasons, I advise to chown root:root updateKDEcache.hook this file.

Explanation

KDE has their own system configuration cache that dolphin uses to fetch all available desktop files. If this cache gets invalidated (eg. by installing software that adds a *.desktop file) dolphin stops using it.
The cache can be manually updated with: XDG_MENU_PREFIX=arch- kbuildsycoca6 --noincremental

The provided hook automatically runs a similar command:
/bin/bash -c "sudo -u \"$(logname)\" bash -lc 'XDG_MENU_PREFIX=arch- /usr/bin/kbuildsycoca6 --noincremental'"

We want to update the cache of the current user (hooks are executed as root) => sudo
kbuildsycoca needs some environment variables that are set by loginshells (hooks are executed in a slightly sandboxed environment) => bash -lc

About

pacman hook to update the kService desktop file configuration cache

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors