Set the type of accent color via cli (from theme/wallpaper/custom)

Hi there,

posted this on reddit a while ago but just learned from Nate’s blog that here might be abetter place :wink:

So here we go with copy&paste:

is there a way to switch the accent color from “custom” to “from wallpaper” or “from theme” via cli?

“plasma-apply-lookandfeel -a colorname” of course does a bit in that direction, but you have to change the setting to “custom” in the systemsettings / appearance/colors section before. If the setting is “from theme” the command is accepted but has no effect.

In my little theme switcher script I’d need to do sth. like “plasma-apply-lookandfeel –type custom -a colorname” but there’s no such option.

Do you have a hint for me?

Thanks!

Use plasma-apply-colorscheme

From theme: kwriteconfig5 --file kdeglobals --group General --key accentColorFromWallpaper false

Great. I’ll try this asap.

Okay, so this switched the flag indeed.

But if I use accentColorFromWallpaper true - in opposite to GUI - the CLI doesn’t calculate the AccentColor.

If I use the GUI the AccenColor in kdeglobals changes.

What invokes the calculation of AccentColor value? Can this be added as a third (qdbus) command to kwriteconfig5, plasma5-apply-colorscheme?

Thanks fusionfuture so far for you answer :slight_smile:

I don’t know if there is a dbus command to change the setting, but plasma-apply-colorscheme does the same thing as the Apply button in Color KCM does.

Hm, CLI commands are accepted but have no effect. I tried plasma5-apply-colorscheme and kwriteconfig5 in any order even in combination with setting a new wallpaper, but no effect on GUI. The kdeglobals entry changes but no new accent color is “calculated”.

So no luck with settings via CLI.

(I also submitted a qdbus org.kde.KWin /KWin org.kde.KWin.reconfigure after all commands as I read this might be needed to reload manual changes to configs… No change, too)

Try qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.refreshCurrentShell not sure if there’s another way (there probably is) but that works here