KDE : Fully create new user from admin script (graphical environment).

Hello.

When creating a new user (with administrative rights) :

    useradd --create-home --comment "$WORK_USER" "$WORK_USER"
    passwd "$WORK_USER"
    usermod -aG vboxusers "$WORK_USER"

At this step, only /etc/skel is copied to user’s home.
.config, .local, … are not yet installed.
Initialization is finished by script(s) when the user log for the first time.
Currently I run two scripts.
After running the first script, I log out , then I log in as the new user so the user configuration complete, then log out, then log in as myself.
Then I run the second script to finished user configuration.

Is there a way to run the kde first log in script as the new user without quitting my script ?

Any help is welcome.

This is the way it is designed. Every application (and that includes the application suite that forms a desktop environment) checks on it’s start if there is/are already configuration files for it. When not it starts a initialization sequence.

I doubt it is a good thing to try and interfere with this thought out policy.

In larger businesses who put a premium on automation,
This is commonly implemented by enterprise configuration solutions like Puppet and Chef.
You might also be able to do some of that by using AutoYaST.
Because I don’t work in a large enterprise network and I’m used to creating installation scripts with simple, basic commands I don’t mind simply executing the scripts in separate steps.

TSU

How many dollars it costs to make an initial configuration to 500 laptops ?

Hi
Is just initial configuration the only requirement? If so I would look at pxe boot with an image already configured…

I think the lack of clarity is based on understanding the problem.

Re-reading the original post,
Seems to me that the question is actually whether it’s possible and how to fully configure the new User on the machine since the script (as expected) only sets up the existence of the new User account, and the actual creation of the various objects like the Desktop’s personal preferences aren’t set up until the User logs in the first time.

That’s a somewhat unusual question since IMO most Admins are satisfied with letting things happen as they naturally occur,
But to do what is requested,
I’d imagine that is possible by simply logging in as a separate session (and likely separate display… Somewhere I remember that this first login can’t be done remotely and has to be done as a local interactive login). Once completed, logout.

TSU

It is not the initial configuration of a pc/laptop, it is rather the initial configuration of each new user.

I have two scripts that do the job. But I have to manually switch to the new user to permit KDE to complete user installation.
Opening a terminal and login as the new user does not help. KDE config files are not completed that way.

How to open a separate session so that KDE complete user installation within my bash script.