KDE System Administration/Environment Variables

From KDE Wiki Sandbox

Template:I18n/Language Navigation Bar

Introduction

There are numerous environment variables that are useful when managing and controlling a KDE environment. Supported environment variables are listed below.

Automatically Set Variables

KDE_FULL_SESSION

Set to true by KDE startup, it is used by some programs, such as Konqueror, to know if they should consider remaining in memory for future re-use when being closed. If not set, those programs will exit after being closed (e.g. kdesu does that, it's also useful for debugging).

If you plan on using this variable to detect a running KDE session, check if the value is not empty instead of seeing if it equals true. The value might be changed in the future to include KDE version information.

KDE_SESSION_VERSION

Introduced in KDE4, this environment variable is set to the major version number of the KDE desktop being run on startup. This allows one to know which kde?-config to run: kde${KDE_SESSION_VERSION}-config. For KDE3 this will resolve to kde-config and for KDE4 this will result in kde4-config. One can then use this knowledge to query more details, such as the minor version, prefixes, etc.

Display and Window Management

KDEWM

If the KDEWM environment variable has been set, then its value will be used instead of kwin as KDE's window manager within the startkde script.

KDE_DISPLAY

An old(?) way to set DISPLAY for multihead.

KDE_MULTIHEAD

Set this variable to true to indicate that KDE is running on a multi-head system.


File System

KDEDIRS

Overrides KDEDIR and allows you to specify multiple directories where KDE searches for its data. Useful if you want or have to install some programs to a different prefix than the rest of your KDE.

Please note that at least the startkde script expects the KDE install directory to be listed first.

KDEHOME

If not set, KDE uses ~/.kde as directory where your personal data is stored.

KDE_HOME_READONLY

Set this variable to indicate that your home directory is mounted read-only.

KDEROOTHOME

If not set, KDE uses ~root/.kde for root's personal data. This was introduced to prevent KDE from accidentally overwriting user data with root permissions when a user runs a KDE program after switching to root with "su".

KDESYCOCA

Allows you to specify the path and the name of the generated KDE configuration cache file.

KDETMP

Allows you to specify a path other than /tmp for KDE to store its temporary files.

KDEVARTMP

Allows you to specify a path other than /var/tmp for KDE to store its variable files.

Localization

KDE_LANG

Allows you to override the KDE language configuration. For example, "KDE_LANG=fr kprogram &" starts a program in French if the necessary files are installed.

KDE_UTF8_FILENAMES

If this environment variable is set, KDE assumes all filenames are in UTF-8 encoding, regardless of the current C locale.

Networking

KDE_NO_IPV6

Set this variable to disable IPv6 support / IPv6 DNS lookups.

KDE_USE_IDN

The content of this variable defines for which top level domains the usage of IDN is enabled. If not set, "at:ch:cn:de:dk:kr:jp:li:no:se:tw" will be used.

Performance Related

KDE_IS_PRELINKED

Set this variable to indicate that you have prelinked your KDE binaries and libraries.

KDE_MALLOC

If set to "1" the fast malloc routine provided in kdecore is used if KDE was compiled with --enable-fast-malloc, otherwise the libc's routine is used.

KDE_NOUNLOAD

If this variable is set, then KLibLoader is told to never unload dynamically opened libraries.

KDE_DOUNLOAD

If this variable is set, then KLibLoader is told to always try to unload dynamically opened libraries. Warning, this will most probably lead to crashes!

Troubleshooting and Debugging

KDE_DEBUG

Setting this variable disables KDE's crash handler DrKonqi and instead lets the application create a core dump. This allows post mortem debugging. An alternative to KDE_DEBUG is launching the application with the command line option --nocrashhandler. Setting ulimit -c 0 will also prevent core dumps.

KDE_COLOR_DEBUG

Starting with KDE 4, setting this variable will get you colorful debug output.

KDE_FORK_SLAVES

Set this variable to spawn KIO-slaves directly from the application process itself. (By default, KIO-slaves are spawned using klauncher/kdeinit.) This option is useful if the KIO-slave should run in the same environment as the application; this can be the case with Clearcase.

freedesktop.org Compliance

The following environment variables are defined in the freedesktop.org base directory specification and are supported by all XDG-compliant environments and applications, such as KDE.

XDG_DATA_HOME

Defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share is used.

XDG_CONFIG_HOME

Defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config is used.

XDG_DATA_DIRS

Defines the preference-ordered set of base directories to search for data files in addition to the $XDG_DATA_HOME base directory. The directories in $XDG_DATA_DIRS should be separated with a colon ':'. If $XDG_DATA_DIRS is either not set or empty, a value equal to /usr/local/share/:/usr/share/ is used.

XDG_CONFIG_DIRS

Defines the preference-ordered set of base directories to search for configuration files in addition to the $XDG_CONFIG_HOME base directory. The directories in $XDG_CONFIG_DIRS should be separated with a colon ':'. If $XDG_CONFIG_DIRS is either not set or empty, a value equal to /etc/xdg is used.