Ubuntu – gsettings like tools for KDE

alternativecommand lineconfigurationkde

We can change fonts in GNOME, XFCE, Unity sessions using terminal commands. But I haven't found any such thing for KDE. Is there anything that does the job of tools like gsettings or dconf for KDE?

To clear the question more, I know I can use System Settings GUI tool for changing settings. But It's boring to open it for simple task like this. Also It's cumbersome to use in a script.

I'm using KDE 5 in Ubuntu 16.04

Best Answer

From https://userbase.kde.org/KDE_System_Administration/Configuration_Files

For scripts or modifying files from the command line, the command line app kwriteconfig is very useful. kwriteconfig expects a configuration file name, a group, a key, an optional type and a value, such as:

kwriteconfig --file kickerrc \
             --group General \
             --key AutoHidePanel \
             --type bool \
               true 

From https://manned.org/kwriteconfig/d47c2de0

kwriteconfig is a command line tool to write values in KDE configuration files. Nonexisting files/groups/keys will be created.

This site gives also more detailed information about the syntax of the command.

Typing kwriteconfig --help in terminal will display something helpful. man kwriteconfig does not work, a man-page does not exist in my system.

To read a Kconfig-entry you can use the command kreadconfig. kreadconfig --help displays useful information about the command. A manual does not exist in my system. https://manned.org/kreadconfig/40c5a73d gives more details.

These commands seem to be part of the packages kde-cli-tools,kde-cli-tools-data, these packages should be installed by default in Kubuntu. You use KDE 5 on Ubuntu and these packages might not be installed, you should check that...