changing themes via terminal

i really like to tinker with kde and create different themes all the time. its a shame i can always just use one at a time. so i thought it must be possible to write a script which changes the right stuff.

id need to have it switch the colorscheme, the icon theme, the wallpaper, the plasma theme, latte dock layout and the plasmoid layout.

i assume all these things are saved in the rc files like plasmarc, lattedockrc, plasmashellrc etc files but i dont know all the files i need.

the next thing is- does the script need to change the text inside these files or can i create new files like theme1plasmarc for example and make the system use this file instead of the original plasmarc file?

so- does anyone have an idea where these things are saved or does anyone know if such a script exists already for kde (i cant be the first one who wishes to switch themes via termnial).

btw- the option to pack the current theme up into a look and feel theme and then just switch the l+f theme in the settingsmanager doesnt work. tried that but either i did it wrong or i just cant do the things i need it to do.

Install bmenu

                          ::Main menu::
 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚    1   Hardware and drivers         2   Display             โ”‚
 โ”‚    3   Printers                     4   Appearance          โ”‚
 โ”‚    5   Package manager              6   Network             โ”‚
 โ”‚    7   Sound                        8   Configuration       โ”‚
 โ”‚    9   Time settings                T   Taskmanager         โ”‚
 โ”‚    F   File Manager                 B   Browser             โ”‚
 โ”‚    S   Search                       I   Init-system         โ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
          Select an item       -       0   Exit

See option 4 Appearance. Maybe analyze the code of bmenu and let it inspire you.
But I don't know how well it works with Plasma, it works with LXDE.

ill look into it. i personally thought more towards kwriteconfig5 but ill take a look at bmenu

When you find out, please give some feedback. I always wondered the same question (handling Plasma rc_files via terminal, if it is possible). :+1:

Everything you are describing would be handled by 'look-and-feel' themes (now known as 'global style'), except the latte-dock part (as it is not part of plasma).

Also .. there are plasma toolkit specific commands you can use to do these things, but I cannot look them up right now .. use your search-foo.

exactly...

what I would do (probably)

  • make a look-and-feel theme
  • write a script that
    a - automates selecting and applying that look-and-feel theme
    b - applies latte settings (see latte documentation for that.. IDK)
    c - (optional) downloads and installs necessary packages before (a) and (b)
3 Likes

The one for changing Look and Feel / Global Style is:

lookandfeeltool -a THEME

You can use the -l flag to get a list of theme names.

then i must have done something wrong (not that its unlikely tho...lol)

i installed the plasma look and feel explorer. filled in all the neccesary stuff to create a new theme and then i clicked on layout from current desktop and defaults from current desktop.

it works in that regard that it creates a new look and feel theme i can select in the settings manager. however. changing to the breeze theme and then selecting the newly created one which in theorie should make my desktop look the way it looked before, does not work as expected. the icon theme wont be switched and the plasma layout changes from "mac look" (latte dock and top panel) to "Windows look" with a taskbar and no topbar.

i think creating a working l+f theme would be a great start. then id just need to write a liitle script which changes the latte dock which shouldnt be too hard (assuming everything i need is saved within the lattedockrc file).

sooo- how do i create a working l+f theme? have i done something wrong within the plasma l+f explorer?

do i need something else besides that program?

If you like, you can have a peek at one of mine (though some params are purposefully missing)

1 Like

Ahh, nice. It gave me the idea to

pacman -Ql plasma-desktop | grep "/usr/bin/"
pacman -Ql plasma-workspace | grep "/usr/bin/"
pacman -Ql systemsettings | grep "/usr/bin/"

Then check <command> --help :stuck_out_tongue_winking_eye:

1 Like

nice one.

this is how mine looks:

did u create your l+f like i described or how did u do it?

i really wonder what i did wrong

Similar porting .. but crossed that with a hard-copy from a fork .. then a bit of hand-work for a few things. Especially filenames and paths and all that.
(you can similarly find a good resource in breeze -/usr/share/plasma/look-and-feel/org.kde.breeze.desktop/)

1 Like

thanks. ill look into it and see whats responsible for the bug

Forum kindly sponsored by