I would like to backup some KDE settings but don’t really know which files to copy from .config
Searching for their names in github.com/KDE has given me some idea about their purposes but I couldn’t find any comments or documentation there either.
I have some advice on doing this. This is coming from my experience with creating an ansible role to fully setup a plasma desktop with all of my preferred configurations on a fresh computer from scratch: You can find the repo here for reference: github.com/alyxxy-net/ansible-role-alyxxy-kde
For context, this is coming out of a process of trying to minimize the amount of files to keep track of and creating a minimal base config that is easy to apply on any device, so it might not cover all of your needs if you have a more complex setup. It has also just been updated and tested for plasma 6 on Debian testing:
Enough context, here are the files that I have found important to backup and what they do:
~/.config/dolphinrc Contains the settings for the dolphin file manager
~/.config/kdeglobals Contains settings for color scheme, icon theme, and widget style, maybe other appearance settings as well if you aren’t using a default theme
~/.config/kglobalshortcutsrc Contains all of the keyboard shortcut/hotkey settings
~/.config/khotkeysrc This file is a bit harder to parse, but it looks like it covers custom user created shortcuts and well as a bunch of other stuff including gestures. I definitely plan to dig into this more, but I will admit that I don’t have the best understanding of this config file XD
~/.config/klaunchrc Covers application launch feedback, this is where I have the bouncing icons turned off
~/.config/kscreenlockerrc Contains settings for screen timeout and locking
~/.config/ksmserverrc Contains session settings, this is where I have the setting to login with a fresh setting instead of trying to restore an old one
~/.config/kwinrc Contains the virtual desktop settings (how many are defined and what layout they are in) as well as plugins/effects that enabled or disabled, the window focus policy, the global animation speed and hot corners settings. This is one of the more important configs that defines a lot of behavior, it probably also covers more things that I am not using. It is also very easily readable :)
~/.config/plasma-org.kde.plasma.desktop-appletsrc This is another really important config. It contains all of the panel and widget settings, including system tray settings. It can be a bit hard to parse and read, but it follows this basic format: [Containments][numeric id] This defines a panel
[Containments][numeric id][applets][numeric id] This defines a widget or other object that is part of the panel.
In general, there will be entries to define all of the panels and their components, and further entries (matching the [numeric id] of the definition entry) that define their configuration and placement within the panels.
~/.config/plasmashellrc Contains more panel definition settings for panel behavior and dimensions, much more brief and less comprehensive than the previous config, not sure why they are even separate in the first place shrug. The panels are identified with the same [numeric id]
~/.config/plasmarc Contains theme settings
~/.config/gtk-3.0 and ~/.config/gtk-4.0 directories Contains appearance settings for gtk apps to match the plasma theme and color settings
~/.config/xsettingsd directory Contains more settings for gtk apps appearance and behavior (icons, toolbar style, fonts, cursor settings, etc)
That’s all of the files I am keeping track of and porting over from ~/.config/ Next up is the stuff in ~/.local/share
~/.local/share/konsole Here be the terminal profile settings
~/.local/share/plasma/plasmoids This is where any extra plasmoids/widgets that you have downloaded and added are kept. These are pretty easy to copy around directly without having to track them down and download again, but they also might break between major plasma versions
Whew, ok, we are almost done! The following parts are how I handle wallpaper and themes/colors.
For wallpaper, I actually have a pretty janky method of nuking the contents directory of the default plasma theme at /usr/share/wallpapers and tossing my own images in there matching the file naming because I am a monster who was tired of analyzing config files when I decided on this approach XD
I used to use a custom theme (more details on porting that below) but when moving from plasma 5 to 6 and porting it over for testing… It broke so hard that I swore off custom themes completely (I couldn’t even open the settings menu, it would technically “open” but the window would never display)
My new approach is to use the plasma dark theme that is included by default, modify the colors settings and save them as a new profile. This actually got me everything I wanted from a theme anyway and only creates one file to keep track of!
~/.local/share/color-schemes/<name>.colors
Any custom themes you have downloaded will be in the following directories (including the one above)
~/.local/share/aurorae/themes/
~/.local/share/plasma/desktoptheme and ~/.local/share/plasma/look-and-feel
A trick you can do to find out individual settings files, is:
- In your
~/.config
folder, rungit init
. git add .
git commit -m "Initial commit"
- Change a setting in the GUI.
- Run
git status
orgit diff
to see which file got changed.
You can then run
git restore .
and repeat from step 4.If you’re done checking settings, just delete
~/.config/.git/
.Or do something like this, which is simpler, easier on your SSD, and doesn’t require installing git:
find ~/.config -mmin -3
That finds files under the
.config
directory that were modified less than 3 minutes ago.Ah, neat. I had to come up with my trick, because I wanted to know specifically which line changed to what. That’s pretty easy to see with
git diff
then. But yeah, if you just want to know which files changed, that’s certainly saner. 🙃thanks thats really useful! its amazing how much utility the linux shell has
(thanks both of you)
You’re welcome.
BTW, commands like these predate Linux. You’ll find them on BSD, macOS, Solaris, and practically every other OS with a Unix heritage.
Edit: You might find this video (or at least the segment I’ll link) interesting.
- In your
Most of them have the app name in the config file. And the config files are largely human readable. Sort of self documenting.
Why not just back up the whole folder though?
Don’t want to backup the whole folder because I only want to keep a few key settings (specifically my taskbar/widgets positions/config) but I guess I will backup whatever I think is probably related.