how can i script kde settings?

I want to create a bash script that I can run when setting up new machines to get KDE "most of the way" how I like it in terms of layout, tweaks, etc. but not sure how to use kwriteconfig5

I am coming from Cinnamon and in the past I could usually automate most user-settings via either gsettings or config files. I also played around on xfce a little. It wasn't for me but it did teach me that I need to be concerned not only about where a setting lives but also worry about if currently loaded settings will overwrite any changes I make to the config files

Since I am new to KDE and not really sure how settings are managed there yet (e.g. is it safe to just edit config files with sed etc or do they get overwritten?), I'm looking for some guidance on how to go about scripting this.

For reference, some things I am trying to do (not asking anyone to do them for me... I just want to know how and am trying to give some concreate example... if anyone wanted to do one of them as an example, I woulnd't say no but i really do want to learn how to do it myself):

  • Change time format on bottom panel to use format %a, %b %e, %_I:%M %P
  • Unpin any and all of the default Task Manager icons like Dolphin, Discover, etc that are on the panel and replace them with Widgets (but only keep Konsole and Dolphin).
  • Change from Icon-only Task Manager on bottom panel to use the full/icon+title Task Manager
  • Add custom hotkey Super+V for launching vlc
  • Turn off all UI sounds, except the sound that gets played when adjusting the volume... actually, KDE might do this by default. not sure. But Cinnamon system sounds it always annoyed me
  • Customize dolphin toolbars
  • Make Konsole font bigger so it easy to see on a TV

I am playing with Fedora KDE rn but would also like the script to work on Endeavour

I saw some stuffs online about kwriteconfig5 but even after looking at kwriteconfig5 --help I am still confused how to actually use it in a batch script and all the examples I found online were for themes and stuff (like here), are old like from kde4, or are in blacked out reddit subs and cant see them (like here and here)

edit: just found this which makes me think maybe I can just use sed and edit configs directly? So confused why kwriteconfig5 is mentioned everywhere if I can just edit configs...

Also is there any good tools for tracking down the chagnes? Right now, I am making backup #1 of ~/.config, then making change in GUI, then making backup #2, then comparing #1 and #2 for changes... it works most of the time but is real slow. If there are better ways, I am open.

bionade24,

e.g. is it safe to just edit config files with sed etc or do they get overwritten?)

You shouldn't use shell + sed but a template engine for such a task, e.g. Ansible + jinja2. Then you can always redeploy the config you stored instead of relying that your sed commands still change the lines in the update config correctly.

Or you can use a dotfiles manager like https://chezmoi.io

So confused why kwriteconfig5 is mentioned everywhere if I can just edit configs

KDE settings can change heavily in structure when they replace the startmenu or smth similar.

Atemu,
@Atemu@lemmy.ml avatar

Not the answer to your question but perhaps a solution to your problem and/or some inspiration: https://github.com/pjones/plasma-manager

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linuxquestions
  • ethstaker
  • thenastyranch
  • GTA5RPClips
  • everett
  • Durango
  • rosin
  • InstantRegret
  • DreamBathrooms
  • magazineikmin
  • Youngstown
  • mdbf
  • slotface
  • cisconetworking
  • kavyap
  • JUstTest
  • normalnudes
  • modclub
  • cubers
  • ngwrru68w68
  • khanakhh
  • tacticalgear
  • tester
  • provamag3
  • Leos
  • osvaldo12
  • anitta
  • megavids
  • lostlight
  • All magazines