LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Script to change the Color Schemes in KDE Automatically (https://www.linuxquestions.org/questions/linux-software-2/script-to-change-the-color-schemes-in-kde-automatically-770963/)

AJones 11-23-2009 07:35 AM

Script to change the Color Schemes in KDE Automatically
 
Hi:

I am looking for a script to change the KDE Color schemes automatically. Without going to KDE Control center and changing it manually. If there is one please give it to me.

Thanks,

Regards
Alan

i92guboj 11-24-2009 12:17 AM

Quote:

Originally Posted by AJones (Post 3766660)
Hi:

I am looking for a script to change the KDE Color schemes automatically. Without going to KDE Control center and changing it manually. If there is one please give it to me.

Thanks,

Regards
Alan

Change how and when? To what color scheme?

AJones 11-24-2009 01:34 AM

Hi:

I have a list of KDE 3.5 color schemes in ~/.kde/share/apps/kdisplay/color-schemes. I just want a script that will rotate these color schemes every day/hour, without me manually going to ControlCenter and choosing different color-schemes and choosing Apply. Can this be done?

Thanks,
AJ

i92guboj 11-24-2009 02:04 AM

Well, I guess yes, it should be doable in bash with some scripting. It's a matter of locating where that set is configured, and changing it with any other. I've tinkered with this in fvwm and have used it to make fvwm automatically detect the color set of kde apps and theme itself in a similar way.

It's not trivial though, and I don't have any kde3 stuff to check, so I can't help with the scripting.

Another thing that I am not sure about is whether there's a way to make kde apps automatically change the colors on the fly, if not, anything changed outside kde would only affect the apps that you open from that moment.

A way to start would be this:

Code:

grep -i ksrc ~/.kde/*
I think that "ksrc" was the extension that the color files used in kde3, if not, change it accordingly. This will give you the files containing that string, you should be able to locate the one that's responsible for loading the kde color scheme. That's half of the work, the rest is just figuring a sed, awk or whatever statement you prefer to change that file name by something else.

Once you have that you just need to put the pieces together into a loop so it runs once every hour.

Again, I have no idea if the applications will addapt on the fly. I'm more inclined to think that they will not. I have no idea if that's even possible to do from outside kdelibs, and the only way I know to reach the kde3.x apps from command line is via dcop. No idea if it will help in this case.


All times are GMT -5. The time now is 03:06 PM.