|
Konfiguring KDE2
Finding Help in the Right PlacesI was all ready to write a note to the KDE Developers mailing list. "Here's the problem," (I was going to say). "I run XPlanet as my desktop, with a map of the moon and the whole thing set to be a realtime moonphase clock. And I run Konsole [the excellent KDE terminal emulator] in transparent mode, so that I can see my desktop through it. The problem is, there's little in the way of foreground color choice--white and black are the possibilities, and either one assures that I'll miss some of the text all of the time. Could somebody maybe provide a choice in red, or yellow?" At that point it hit me: Here are all these guys working their tails off to provide a fine desktop environment for my use and enjoyment, and I'm asking somebody to drop everything for what is really, when you get right down to it, a trivial request. (This is, unfortunately, likely to become more and more common, too, as refugees from the commercial, closed-source world, where one has to demand a new feature if it's to be implemented, move to the open source community.) I was going to make this request without having done the slightest thing, other than scan the Konsole options menu, to see if I could fix it myself. I closed KMail and started looking at the KDE source code. Sure enough, in /kdebase/konsole/other, there were files for various schema, which is what Konsole calls its color schemes. I opened one, the one that makes Midnight Commander (the great console file manager) transparent, too, when it's run in Konsole. A bunch of color values were there, listed in standard RGB notation, where 255, 255, 255 is white and 0, 0, 0 is black. The top two lines were foreground and background. I don't know the alchemy behind making the background transparent, so I left that line alone (I didn't want to change it, anyway). But the foreground line I changed from 255, 255, 255 to 255, 0, 0. I saved the file, recompiled Konsole, and lo and behold! Bright red text! Nice, but pretty inelegant. Next pass, I changed the color labels so that the foreground was labeled Red, not White, changed the title line as it would appear in the options menu, and saved the file under a unique name within the .schema naming conventions. I also restored the original file to its pristine state. Another quick recompile--takes less than five minutes--and a setback: My new schema was not on the menu, and the original, having been restored, was back to white. You can see the steps taken in the four screen shots to the right. In Figure 1, the default KDE2 Konsole transparent background, as you can see, is an eyekiller with my background program, XPlanet, and the moon. In Figure 2, with a little pseudo-hacking, I have some new choices. Figure 3: A lot better, don't you think? Figure 4: Okay, it doesn't change the colors in Midnight Commander, but the effect is cool anyway.
Quick Hack vs. Elegant HackA hacker who knows what he's about would at this point have dived into the Makefiles to see why my little variation on a schema wasn't getting installed. I'm not such a hacker, but I was prepared to try this and really break some stuff, but first .... One of the hardest habits to break when moving to Linux or another open source OS is the thought process that says that configurations are stored in mystically compiled and cleverly hidden binary files, that if it ain't on a menu, you can't order it. But in Linux, virtually every configuration is in plain text someplace. Yes, all those fancy GUI tools are simply specialized, glorified text editors. They do prevent a lot of mistakes, and they do format everything nicely, but their output is nevertheless plain old ASCII. KDE is no different. It stores individual user settings in ~/.kde (the hidden kde directory in the user's home directory), and the possibilities in the /share/apps/ directory of the main KDE directory (usually /opt/kde). So I took a look. In /opt/kde/share/apps/konsole, I found the various schema (schemae?) that are installed when Konsole is. They were utterly unchanged from their incarnation in the source directory. I copied my nifty new file to this directory, fired up Konsole, and there, on the menu, it now appeared. I was so pleased with myself that I made two more, one with bright green text and one with bright yellow text. Putting them in the proper directory gave them a place on the options menu, too. Now. If the purpose of this little story were to demonstrate that I'm a kewl haxor d00d, anyone with the brains to have switched from Windows could see that I've fallen waaaay short. Fortunately, that's not the point.
Guruism Made EasyInstead, this is a call to hack. KDE2 now mostly builds without too much trouble, and runs fairly reliably for a very complicated system months away from release. Anybody can get the source (from ftp.kde.org/pub/kde/snapshots/current) and compile it. It isn't difficult, and if not all of it will build, enough will to keep you interested for quite awhile. And if you're not willing to compile it yourself, guruism is not beyond your reach; Christopher Molnar of Mandrake Software regularly compiles and makes available binary distributions at ftp://us.mandrakesoft.com/pub/kde. (What is beyond everyone's reach at the moment is the right to complain about stuff that doesn't work yet. It's not supposed to work perfectly yet.) But by year's end, it will likely be the default desktop for many if not most Linux distributions, and is certain to become a standard (if not the standard). So if you want to amaze your friends, learn a great deal without a lot of effort, and become the resident KDE2 guru, now is the time to start. Roll up your sleeves and dive right in! You can hack KDE2 without knowing a bit of code, because it's all there in plain text. Look in the /share/apps dirtectory. Open some files. try some things. Reconfigure stuff all over the place if you want. If you break some stuff and can't back out, just install again. (Or, if you're the careful sort, you can backup the working file before you "improve" it.) Fact is, this doesn't apply just to KDE2. You can mess around with just about anything Linux and make significant customizations without having to write code or even compile it (though if you're going to use Linux, you're going to need sooner or later to compile an application or two or a dozen, so you might as well learn now). And even if you're afraid to change anything, simply viewing these files (and the individual user configuration files) will give you more of an understanding of the way things work than you could ever imagine.
Going Hog WildTwenty years ago, when I was a newspaper reporter, I worked with Adam J. Nagourney, now a reporter for The New York Times. I remember two things about him: he was (and is) a fine reporter, and he was the only touch typist in the office. Annoyed that other people were sitting at his desk when he wasn't there, which often resulted in his desktop (actual, not virtual) getting messed up, he rearranged the keycaps on his Selectric typewriter. Now no one used his desk, because no one could type there. That worked fine for him, and it can work for you if no one else ever uses your machine or is served by it, if you never wish to discuss your system with anyone else, and if you never wish to get technical help from other users. KDE2, like almost all of Linux, is just a hair this side of infinitely configurable, and if you change everything that you can change, no one else in the world will be able to use your machine (nor will you, once accustomed to your configuration, be able to use any other machine). It is possible to go too far. On the other hand, changing everything could be a security benefit--no one is going to screw up your machine if everything they encounter defies all common logic. (And in an era where employees are in great demand, establishing a company-wide system unlike anything one would encounter anywhere else would make your fine employees, trained by you, useless to another company.) But the chances are you'll be content to master the configuration options that you don't find on a menu, create your own, and produce a system that gives you that little edge in convenience and versatility that you seek. Have at it! Oh, and one thing more. If you arrive at a configuration that you think would be of use to others, save it with a unique filename so that it doesn't overwrite another file if someone were to apply it, then send it to the maintainer of the application. In KDE apps, this can always be found in the Help > About menu item for the particular application. Offer it for inclusion in the KDE (or other) distribution. Sometimes it will be, and in any case interest is shown. Be sure to add a note of thanks to the author for making an application for you to play around with. And it might just be that with some pride you can point to your contribution to the effort.
|