This forum has been archived. All content is frozen. Please use KDE Discuss instead.

can you configure KDE from the command line?

Tags: kde4.4, command line, cli, shell, bash, configuration kde4.4, command line, cli, shell, bash, configuration kde4.4, command line, cli, shell, bash, configuration
(comma "," separated)
User avatar
foxofinfinety
Registered Member
Posts
22
Karma
0
OS
this concerns all of KDE, not just one program, so I'll just leave this here...

as the title says, it is possible to use commands to configure KDE.
I want to make a shell (or actually, bash) script that will make a computer to my liking by installing the software I want, and remove the software I don't.

but now I actually also want it to configure KDE(4.4) for me at the same time.

the idea is like this:
install my software.
remove unused software.
update the system.
configure KDE.
reboot the computer (so that all changes will take effect)


but I have no idea how I can configure KDE from the command line.
if that is possible in the first place.

so for example, I can use the cp command to copy a wallpaper image to /usr/share/wallpapers/
but can I also give a command to also apply that wallpaper I just copied?

and if I can configure KDE from the command line, what can I configure and how can I do so?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
With the right set of parameters given to "kwriteconfig" it is possible to change the behaviour of virtually any KDE application ( for the graphical interface layouts themselves, you will need to take copies of the required *ui.rc files from $KDEHOME/share/apps/<application>/ )

Make sure no KDE applications are running though when you do this, since many will flush their configuration state to disk when closing, overwriting your changes.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
foxofinfinety
Registered Member
Posts
22
Karma
0
OS
is there a refereance for which options can be configured with which parameter?
I mean it would be some work to make it but after that it saves work since I can just run the script.


also it there a way to read current setings, put them in a text file, and use that text file with kwriteconfig to use settings I get from a existing KDE desktop?
the idea is mainly for my laptop when it arrives and I want to use the settings I have already on my desktop.


as for making sure no kde apps are running, after I login and go to tty1.
sudo service kdm stop
should be enough right? I mean since I only just logged in I didn't start any other programs and ending the kdm process should quit all graphical applications as well.
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS
Wouldn't it be easier to copy your ~/.kde (or ~/.kde4 etc.) with the settings your want? For example, you could ship a tar of you preferred settings with the script. In the script, you just have to
1. Move the current ~/.kde somewhere as a backup
2. Extract your tar to ~/.kde

Outside of Plasma Desktop, of course.


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
User avatar
foxofinfinety
Registered Member
Posts
22
Karma
0
OS
well yes and no.
it would be a simple way but I don't know which file saves which settings and there a some settings I don't want to copy.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Unfortunately, the only documentation, unless the application uses KConfigXT ( which may apps do ) is inside the code of the application itself.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
przemo_one
Registered Member
Posts
3
Karma
0
Is there any command line way to force KDE to apply changes after using kwriteconfig? I am trying to change the titlebar color, and the changes do get written in, and go in effect after I restart KDE, but is there any way to do that without a restart?
User avatar
JanGerrit
Moderator
Posts
647
Karma
3
OS
Maybe you can ask KWin to reread its settings:
Code: Select all
qdbus org.kde.kwin /KWin reconfigure

But I'm not sure whether this helps.


Image
przemo_one
Registered Member
Posts
3
Karma
0
Thanks JanGerrit! This works like a charm.
stfs
Registered Member
Posts
1
Karma
0
I would really like to know if this is possible as well!

-Stefan Freyr.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
The answer is yes - you can configure KDE from the command line - however, whether applications will apply this change at runtime is another fact altogether (some may need to be restarted for the configuration change to apply).

It is recommended to use kwriteconfig when interacting with KDE configuration files to avoid corruption. Please note that minimal documentation on the values themselves is available (although the KConfigXT description files may be helpful if the application uses it).


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft