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

Creating a shell script to configure some aspects of KDE.

Tags: None
(comma "," separated)
User avatar
kde-negora
Registered Member
Posts
7
Karma
0
Hello:

I'm using Kubuntu 14.04.1, although I guess that it doesn't really matter for my question. I'm trying to create a shell script so that I can customize some parts of KDE quickly after a fresh install. I do the maintenance of my relative's computers, so this script would save me a lot of time.

Well, I've been able to create a shell script that configures some of the files placed at $HOME/.kde/share/config/ . It simply replaces some strings in the configuration files by other ones of my preference, using Perl. It has worked well in my testing environment. However, right after a fresh install or after the creation of a new user, some of that files don't exist yet. They're created only after you've run the specific application one time or you have edited its configuration using the corresponding GUI. So I want to know if there's a way to generate that files automatically with default content, or if there's a location in the installation with some kind of templates that I can use.

If there isn't anything like that, I guess that I'll have to copy the entire configuration files from a pre-configured installation to the new ones.

Thank you.
User avatar
kde-negora
Registered Member
Posts
7
Karma
0
Finally I've opted for the last option:

1. I've created a new user.

2. I've logged in and configured what I've wanted. I've monitorized which files have changed. To do so I've executed the command "ls -alR ~" before and after each change, saving the output to 2 different files and executing the command "diff" between them. This way I've found out which configuration files have been affected by which change. For example:

ls -alR ~ > before.list
[Modify a configuration item in System Settings or in an application and push "Apply"]
ls -alR ~ > after.list
diff before.list after.list

3. I've copied the affected files to a custom folder.

4. I've created a shell script that copies the files from my custom folder to the KDE configuration directory of a given user.

Now I'm going to try to put these configuration files directly in the /etc/skel/ folder so that this configuration is applied on every new user. However, I wonder whether they will be overwritten by KDE when the user is created or they will be kept intact. Anyway, this is an optional feature; I've enough with the shell script to save much time of work.

The shell script is of no interest and only contains functions to copy the configuration files and change their ownership. But if someone is interested, I can upload it.

Salutes.
User avatar
toad
Global Moderator
Posts
1258
Karma
7
OS
As you rightly say /etc/skel forms the basis of every new user's ~ and whatever you put in there will be persistent.


Debian testing
User avatar
kde-negora
Registered Member
Posts
7
Karma
0
toad wrote:As you rightly say /etc/skel forms the basis of every new user's ~ and whatever you put in there will be persistent.


I've just tested it and KDE has kept the changes inherited from /etc/skel/ without overwriting them ^_^ . I was afraid that it didn't behave that way. Now I can combine this with a script to re-master Kubuntu for my own needs, including some old computers that I keep :) .
User avatar
toad
Global Moderator
Posts
1258
Karma
7
OS
Easy-peasy! Have fun ;)


Debian testing
User avatar
kde-negora
Registered Member
Posts
7
Karma
0
Thank you. I'll do ;) .


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, mickae, Sogou [Bot]