Configure KDE Plasma desktop and settings via bash

Switched from Ubuntu Budgie to KDE Plasma and I am excited.
I created a simple bash script for Ubuntu Budgie to automatically adjust a few things with regard to the desktop, panel layout, theme etc. Enabling Night Light at 21PM etc. Basic stuff + install some apps and remove some. Not hard core tweaking.

To figure out what command I needed to for example enable dark mode, on Gnome I could run this:

dconf watch /

Then open Settings and start tinkering around. In terminal I would see the commands. Next, I could easily create a bash script using that info.

I tried the same command with Manjaro (KDE), but nothing happens.
With KDE Plasma, does something similar exist?

You should read about kcmshell5 and other KDE cli tools. That’s probably not all command you need to know, sometimes you need to reload module or all Plasma – read about command line options for kwin and plasmashell. You also need to know config file names and parameters (required for modifying with kwriteconfig5) – most of them are placed in ~/.config directory. If you need something more advanced, read KDE System Administration - KDE UserBase Wiki.

You may be also interested with programs mentioned here:

for plasma all config is in files in home{.config,.local}

and we have dbus for write to plasma by script (as gnome…), some function are for config

check list all fonctions for kwin:

qdbus org.kde.KWin  ; qdbus org.kde.KWin /KWin

get shortcuts

qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.shortcutNames

some example KDE Connect/Tutorials/Useful commands - KDE UserBase Wiki

1 Like

Sorry to kick this up.
Is there a method to see (realtime/live) which setting in qdbus is being modified, when I change a setting in the UI?

Otherwise it’s a mission impossible. This is what I am trying to find commands for, to put in a script:

  1. Move the default panel to the left screen edge (vertical).
  2. Disable News (not hide it, but disable it in the News app settings).
  3. Hide Clipboard notification icon.
  4. Only show Updates icon when there are updates available.
  5. Check for updates every week (instead of 6hrs).
  6. Show Date and Time in custom format: ddd d/M
  7. Set Global Theme to Breath2 2021 Dark
  8. Set Icons to ePapirus-Breeze-Dark
  9. Set screen edges: TopLeft: Application Laucher, BottomLeft: Present Windows Current Desktop, TopRight: Show Desktop
  10. Add favourites to Application Launcher: Firefox, Dolphin, Kate, Elisa, KCalc, Skanlite, System Settings, Add/Remove Software, OnlyOffice.
  11. Pin to Task Manager in this order (to show on Panel): Dolphin, Firefox, Gwenview, OnlyOffice, Kcalc.
  12. Move the Pager icon to the right, so that it sticks against the system tray icons.
  13. Dolphin: View Mode > Details, set Preview icon size to 22
    13 Dolphin: set View Mode > Compact as default.
  14. When power button is pressed: Shutdown.
  15. Disable the 30 second countdown when selecting restart/shutdown etc via Application Launcher.