Restore your KDE 4 desktop settings

Very good colleagues, I am going to share with you something that I have learned to make the adaptation to KDE easier for new users who do not handle the KDE 4 Plasma desktop tools.

It turns out that whenever I install KDE for someone who has never used it, they end up deleting the graphical elements of the panels, or worse, the entire panel.

This is a common occurrence as it is easy to unlock graphic elements and delete something by mistake.

Being a new KDE user (and it may come from Windows), it will not be easy to put the graphic element or the panel back in its place, and the desktop may be unusable either because you delete the applications menu, the system tray or the task manager itself.

Then that user will call you and tell you: "Hey, my panel is gone, what do I do to get it back?"

Well, that's what I'm going to try to explain to you in this little tutorial. Put in context, let's get to the point:

An easy way to recover a functional panel is with the option "add new default panel", but what if we have left you a more elaborate desktop and we want to restore it easily?

Let's see: KDE houses 5 configuration files for the appearance and desktop elements that are what we need.

They're in /home/usuario/.kde/share/config/ (At least they are there in Debian Wheezy, in the rest of the distributions if it is not in that place it must be in a very similar one).

Well, in that folder we look for our objectives, these 5 files:

  • activitymanagerrc
  • plasmarc
  • plasma-desktoprc
  • plasma-desktop-appletsrc
  • plasma-windowed-appletsrc

We already have them located. Those files have the configuration that you have given to the desktop in appearance and functionality.

Now we are going to copy them to a folder where they are safe, for example we create a folder called .restore in our user and copy within the 5 files.

Okay, now we turn to the magic of bash scripts. We create a new text file called for example: restore desktop.sh and we give it permission to execute. We open it with a text editor and write the following inside:

#!/bin/bash
cp /home/usuario/.restaurar/activitymanagerrc /home/usuario/.kde/share/config/
cp /home/usuario/.restaurar/plasma-desktoprc /home/usuario/.kde/share/config/
cp /home/usuario/.restaurar/plasmarc /home/usuario/.kde/share/config/
cp /home/usuario/.restaurar/plasma-desktop-appletsrc /home/usuario/.kde/share/config/
cp /home/usuario/.restaurar/plasma-windowed-appletsrc /home/usuario/.kde/share/config/
qdbus org.kde.ksmserver /KSMServer logout 0 0 0

Note: The paths must match those of your system, both for the files to restore and for the KDE configuration files.

Ready. Double-clicking on that file will restore the desktop configuration files and log off for the changes to take effect.

Remember to save what you have open before running it so as not to lose anything that you have not saved when you close the session.

Now when that user calls you who has deleted some graphic element or panel saying what he can do to put it as it was, you just have to tell him: open the file recover desktop.sh that I saved on the desktop and that's it!

I hope it can be helpful.
To share, cheers!


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

15 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Mrc said

    Very good it would have served me a lot when I just installed kde which happened to me exactly = xD it cost me to restore the panels and other things but I did it but your scripts are like a glove to bookmarks in case a friend happens to him: p

  2.   Ghermain said

    Very good article and necessary for newbies and not so newbies like me. 🙂
    I will share it with your respective credits.
    Happy Holidays.

  3.   sieg84 said

    in other distros the folder is ~ / .kde4 /…

  4.   eliotime3000 said

    Good tip. Also, this kind of misstep has not happened to me with KDE 4.

  5.   Mikail said

    Excellent thing about the scripts, at some point when I just tried KDE and it did not handle the environment, I simply deleted the .kde folder and everything went back to how it came by default. Certainly something less refined but at that time it served me hehe. Thanks for the tip.

    1.    sieg84 said

      Sometimes this is a good idea, if you have a ~ / .kde4 / that has had several KDE4 updates.
      once i had to do it in openSUSE, i had the same configuration from the first versions of KDE4, some big changes are made and its better to start over.

  6.   patodx said

    Thanks for the info. I have never deconfigured plasma, but it is not too much to know.

    greetings.

  7.   eVeR said

    KDE folks should be asked to save desktop layouts (system defaults or user-created).
    Something similar can be done with activities, but few people understand them.
    regards

  8.   Manuel R said

    Thanks for sharing, it will be useful to me.

  9.   Outdated said

    I am glad that it is useful to you.

    It can also be used to experiment with the desktop and then quickly return it as it was.

    Health!

    1.    Outdated said

      … Or to have several configurations, for example one with a dock, another with a task manager, etc. and easily switch between them depending on the occasion.

  10.   Outdated said

    Note: if you use these files to save your configuration and restore it to another computer or to another Linux installation, be careful because the plasmarc file contains the information to put a specific plasma theme. You will have to have the same plasma theme installed or skip the plasmarc file to be able to use a different theme when restoring your configuration.

    Greetings.

  11.   Outdated said

    Another thing that I have noticed is that on few occasions it happens that deleting a certain graphic element does not restore it well, in that case you have to delete the entire panel before restoring.

    Salu2!

  12.   Carlos Felipe said

    Isn't it easier to copy the back-up and paste it into /home/usuario/.kde/share/config/ if we poop on our desktop or would it not work?

  13.   xxmlud said

    Good.
    Do you know if it also works with KDE 5 Plasma?