kde-material-you-colors icon indicating copy to clipboard operation
kde-material-you-colors copied to clipboard

Change Current Theme's Colors Instead of Creating New Theme

Open catuhana opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe. Currently, this tool creates a color scheme from wallpaper, and generates a whole theme.

Describe the solution you'd like Instead of generating an entire theme, change the current theme's color scheme by editing ~/.config/kdeglobals file, and refresh the system theme to make changes appear.

Describe alternatives you've considered None

Additional context The same can be done with Konsole too. For Konsole theme, this tool creates and requires a profile to set Konsole color scheme. Instead of creating and requiring a profile, just generate a color scheme for Konsole, and let the user change the blur, transparency (etc.) configurations themselves.

catuhana avatar Oct 19 '22 10:10 catuhana

Updating ~/.config/kdeglobals would require parsing its contents, convert them to a format python can handle and convert it back to a config file, this because configparser can't handle section names like [Colors:Header][Inactive] so I decided to put it hard-coded as a fstring 😆.

Could be possible but it may be confusing to have a scheme enabled while showing a different one, and would require finding a way to reload ~/.config/kdeglobals file. An alternative could be allowing editing the generated schemes and updating only the colors.

For Konsole, a profile is necessary because one cannot edit the default profile nor have a default colorscheme for all profiles, it would work for active sessions but new tabs or Konsole windows will load the default profile with its default colorscheme.

luisbocanegra avatar Oct 25 '22 20:10 luisbocanegra

For Konsole, a profile is necessary because one cannot edit the default profile nor have a default colorscheme for all profiles, it would work for active sessions but new tabs or Konsole windows will load the default profile with its default colorscheme.

But a profile will always be needed to make it default. Telling the user to create a profile and edit the config to make it work is not good, while you can just tell the user just create a Konsole profile, change theme and set it as default.

catuhana avatar Oct 25 '22 20:10 catuhana

But a profile will always be needed to make it default. Telling the user to create a profile and edit the config to make it work is not good, while you can just tell the user just create a Konsole profile, change theme and set it as default.

So instead of having only one MaterialYou.colorscheme the script will edit the colors in the users' color scheme defined in their profile, right?

luisbocanegra avatar Oct 25 '22 21:10 luisbocanegra

But a profile will always be needed to make it default. Telling the user to create a profile and edit the config to make it work is not good, while you can just tell the user just create a Konsole profile, change theme and set it as default.

So instead of having only one MaterialYou.colorscheme the script will edit the colors in the users' color scheme, right?

Nope. Instead of having to create a profile, just generate MaterialYou.colorscheme theme. So the user won't need to create a new profile, change config value, and port settings from the other profile to the new one. They can just change theme from their profile settings without playing new profile.

catuhana avatar Oct 25 '22 21:10 catuhana

Nope. Instead of having to create a profile, just generate MaterialYou.colorscheme theme. So the user won't need to create a new profile, change config value, and port settings from the other profile to the new one.

Making a new profile is only needed if the user is using the default one [Read-only].

They can just change theme from their profile settings without playing new profile.

As is now, the script should do it by itself, if it doesn't then is a bug

With the current behavior:

  1. The script receives the Profile name from the config/argument
  2. Edits the colorscheme to MaterialYou.colorscheme in said profile
  3. Makes a copy TempMyou of Profile name with MaterialYouAlt.colorscheme which is needed to reload a profile when colors change
  4. Loops through all Konsole windows/tabs and applies either Profile name or TempMyou depending on which one is active, because applying the same profile results in no visual changes. 4.i Because of this you may try to edit Profile name, but the current active profile is TempMyou and you won't see the changes until you start a new Konsole window.

What it doesn't do right now:

  1. Reload all konsole windows/tabs when the user makes changes in Edit Profile window
  2. Allow setting transparency/blur in the Edit Color Scheme window (transparency is tied to config:konsole_opacity ~and blur option does nothing in my machine~ it's working again with Plasma 5.26.2).

luisbocanegra avatar Oct 26 '22 10:10 luisbocanegra

Got it.

catuhana avatar Oct 28 '22 08:10 catuhana