Automatically Running a Script Once

Automatically Running a Script Once

Since KDE 2.2 the kconf_update upgrade utility is part of KDE. Although intended for updating configuration files between version upgrades it can also be used for making sure that an arbitrary program or script is run exactly once for each user.

To do so you need to create a so called update-file and a script and install both into $KDEDIR/share/apps/kconf_update/ The update script should have .upd as extension and should contain the following:

Id=<someid>
File=dummy
Script=<your script>

A single update-file can have multiple of the above sections. The Id is used to keep track which sections have already been executed once. Each section should have a unique Id. Script is the script or application that gets executed. The script should not produce any output because that may otherwise end up in a configuration file called dummy.

kconf_update is executed automatically by kded upon every start of KDE and whenever new update files are installed.

The configuration file kconf_updaterc keeps track of which update scripts and which sections have already been executed once.

See also kdelibs/kconf_update/README.kconf_update.

KDE Logo