This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Changing/applying oxygen color scheme without gui?

Tags: None
(comma "," separated)
ifiknew
Registered Member
Posts
10
Karma
0
I'm trying to change/apply oxygen's color scheme without the use of gui tools. On kde 4.8 changing the values in ~/.kde4/share/kdeglobals dosen't have any effect on application appeareance, unlike on 4.7 where the changes get applied. That leads me to belive that kde 4.8 changed the way it applies it's color schemes... I tried changing the values in kdeglobals manually with a text editor and with kwriteconfig but nothing(no changes in appearance). I ran kbuildsycoca4 --noincremental after every change...
On a sidenote: the color scheme in systemsettings changes to the manually edited one, but it doesn't get applied. I've only managed to apply/get changes in appearance with systemsettings.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
This is likely because applications are not detecting the changed colour scheme perhaps? Have you tried restarting applications to see if they pick it up?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
ifiknew
Registered Member
Posts
10
Karma
0
Too see if the color scheme has been applied i ran khelpcenter from the terminal after every change/attempt, and nothing, I'm not sure if that counts as restarting... But i even kill'd all the kde processes and started an app again to see if the color scheme has been applied but nothing.
Thanks for your reply.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
If you logout then back in again does it have an impact?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
ifiknew
Registered Member
Posts
10
Karma
0
What do you mean by "then"? I'm not using kdm as a login manager so killing all the kde processes doesn't log me out if that's what you meant. But no, changes don't get applied/there is no impact after killing all the kde processes and starting a kde app. I even tried loggin out of the window manager session and then back in and starting a kde app but still no impact.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
I believe I have traced this back to:

Code: Select all
[General]
ColorScheme=Default


It seems that the changed colours are saved to two places - some are saved into kdeglobals, others are saved into a *.colors file (where * is the name of the theme)

These files are stored at $KDEDIR/share/apps/color-schemes/ (where $KDEDIR is usually /usr)
Altered versions will probably be stored at ~/.kde4/share/apps/color-schemes/


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
ifiknew
Registered Member
Posts
10
Karma
0
As i understand it: $KDEDIR/share/apps/color-schemes/ contains the default color schemes that come with kdebase-workspace and ~/.kde4/share/apps/color-schemes/ holds the color schemes that u alterd and saved/exported with systemsettings, i think the alerted values(without saving/exporting the color scheme) just get saved to kdeglobals directly, but i'm not sure of that(did some reading on that a "while" ago, but never tested it).

I think the way systemsetting applies the color-scheme is: it gets the theme from $KDEDIR/share/apps/color-schemes/ and writes it to ~/.kde4/share/config/kdeglobals with some extra stuff added.
diff -u /usr/share/apps/color-schemes/ZionReversed.colors .kde4/share/config/kdeglobals

Silly me i didn't put the ColorScheme line when i did my testing, but i'm fairly certain that i had it in my kdeglobals when i upgraded to kde 4.8 and when it stoped working. Anyhow i now retried with the ColorScheme line but still nothing...
Exact steps:
Code: Select all
su
#Login as root
systemsettings
#Select Application Appeareance->Colors->Select Oxygen Cold->Apply
#Click on Overview
#Close System Settings window
#Get some kwriteconfig msg from systemsettings on the command line
^C
#At this point the Oxygen Cold color-scheme is applied(i see a change in appearance) and sourced from /home/root/.kde4/share/kdeglobals(well, at least i think its sourced from there, changes to that file at this point don't trigger a change in the appearance if i remember correctly).
#Still as root
cat ~/.kde4/share/config/kdeglobals > /home/$USER/.kde4/share/config/kdeglobals #Where $USER is my non root user
#Starting systemsetting to change to color-scheme again to see if i can trigger a change with manually changing my non-root user kdeglobals file
systemsetting
#Select Application Appeareance->Colors->Select Zion (Reversed)->Apply
#Click on Overview
#Close System Settings window
#Get some kwriteconfig msg from systemsettings on the command line
^C
rm -rf ~/.kde4/
exit
#Relogin
khelpcenter
#The color-scheme("Oxygen Cold" in this example) from my users kdeglobals file is not applied, but the "Zion (Reversed)" is still used. I don't even know where kde gets it from since /home/root/.kde4/ where systemsettings wrote it to is deleted. Is there some other place where color-scheme data gets written to?


I just saw your forum signature... Does systemsetting use some private method to apply the color-scheme or does it just prepare the config values and writes them to ~/.kde4/share/config/kdeglobals and updates ksyscoca4?
Thanks for your help and sorry for the late response.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Unfortunately I didn't write the Colour scheme user interface part.
However, one thing you could try changing is the value "ColorScheme" in kdeglobals?

Code: Select all
[General]
ColorScheme=Default


It could be that when you customise the colours, this value is not set - or set to something different. Try customising it through the UI and see what happens.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
ifiknew
Registered Member
Posts
10
Karma
0
Take a look at the pastebin diff link above, the ColorScheme line is in there, i just copied what systemsettings wrote to kdeglobals... so it is not the case(or at least i shouldn't be) of something missing in kdeglobals. As for the ColorScheme values not being set, the values are in kdeglobals and they get noticed by systemsettings - the new color-scheme(the one manually added to kdeglobals) is selected in system settings but is not applied/there are no changes in appearance(no matter if i rebuild ksyscoca4, or relogin)...
On a sidenote: i just noticed i can run systemsettings as a non-root user, before it would complain about some missing view modules(if i remember correctly), so thats why i ran it as root. I'm just saying so that no one thinks i'm crazy for running systemsettings as root before... Tried the above algorithm as a normal user, but still nothing...
Exact steps:
Code: Select all
systemsettings
#Change the color scheme in GUI
cat .kde4/share/config/kdeglobals > kdeglobalsbackup
#Change the color scheme to a different one in GUI
cat kdeglobalsbackup > .kde4/share/config/kdeglobals
#Close systemsettings

#* are actions that are not taken on the cli, not explanations of the commands.
I'm providing a screenshoot if i'm not being clear enough.
Screenshoot

I would say that systemsettings uses a private method to apply the color-schemes and there is no way to change/apply the color-scheme without the use of systemsettings and that this way of handling things was introduced in kde 4.8. Now, should i file a bug? Do you think anyone actually cares that you can't apply a color-scheme without the use of a gui tool?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Firstly, System Settings does not use any private methods, but it does perform quite a few steps to ensure that applications are informed of the changes.

One of these involves the Qt configuration file, ~/.config/Trolltech.conf. Have you tried modifying this file?

As to why this change was made - likely to ensure that Qt applications picked up changes in the KDE Colour palette.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]