docs.kde.org
Tinkering Under the Hood of KDE
Prev
Next

Chapter 16. Tinkering Under the Hood of KDE

Table of Contents

Hand-Editing Configuration Files
Introduction
Backups
Editing
Scripting the Desktop
Adding Extra Keybindings to KDE
Adding Keybindings for New Actions
KDebugDialog - Controlling KDE's Debugging Output
Basic Usage
KDebugDialog in full mode

Hand-Editing Configuration Files

Nicolas Goutte

Introduction

In KDE, the configuration files are easy to edit with a simple editor like Kate as the configuration files are text files.

An example of a text file:

[General]
AutoSave=1
LastFile=/var/tmp/test.txt

The user-specific configuration files are stored in .kde/share/config (replace .kde with your $KDEHOME setting) and the global ones are in the share/config sub-directory of KDE's installation path. (You can find this path by running the command kde4-config --prefix.) Their filenames typically end in rc (without an initial period), for example kopeterc.

Warning

Editing configuration files by hand can risk the stability of your KDE installation. Applications usually do not check what they read from the configuration files. This means that they can be disturbed by what they get as configuration and might even crash.

Backups

So the first rule is to make a backup of your file before modifying it. The backup is better stored outside any .kde subdirectory (or the corresponding $KDEHOME directory). Backups are anyway a good idea in case of a major failure of KDE that would destroy important configuration files (for example your KMail settings, which are in in the file kmailrc). (Such a major failure should not happen but it still can happen.)

Editing

So why would you want to touch the configuration files at all? Well, first you need it when you want to enforce the KIOSK mode. Perhaps a developer has asked you to add an entry to help him to solve a problem with the application. Perhaps you want to recover from a problem without having to remove all the .kde directory. Perhaps you want to learn more about the depths of KDE.

Anyway, whatever your reason, you want to modify by hand a configuration file.

When planning to edit such a file, make sure that the application using it is not running. If it is one of the basic configuration files, consider editing the file while KDE is not running at all.

Ready? So make a backup of the file (Did I tell you this already?), start you favorite editor (let us assume it is Kate), load the file (Be careful to load as UTF-8, Kate displays it as “utf8”).

Now you have a file like:

[Group]
Key1=Value1
Key2=Value2
Key3=Value3

You can now modify it (with care!) and then save it (Be sure that it is as UTF-8 again).

Now you can test the application and if the application does not run correctly anymore, close the application and restore the backup of the configuration file.

Related Information

Prev
Next
Home


docs.kde.org