How To: Getting Linux to look consistent

Nothing is quite as frustrating when using the desktop as having intensely out of play applications all over the place. No one can decide on a unified toolkit it seems, so instead, we have Gtk2 and Qt3, with a handful of applications still floating around in Gtk1, and a couple starting to appear in Qt4.

CraigD’s new QtCurve series of themes is the closest anyone has come yet, and after around three hours of screwing around with the settings and invisible documentation, I got it to work.

First off, go to the KDE-look site’s QtCurve entry and download the source for the KDE3, Gtk2 and Gtk1 versions. For purposes of this example, we will work in the home folder.

First off, you need to get the gtk-theme-switch app, because it’s going to be the easiest way to get the Gtk1 steps to work. If you don’t have any Gtk1 apps, you can ignore this, or else grab one to test it out. The Putty SH client is probably one of the most common Gtk1 applications.

tar zxpvf QtCurve-Gtk1-0.42.2.tar.gz
tar zxpvf QtCurve-Gtk2-0.52.3.tar.gz
tar zxpvf QtCurve-KDE3-0.52.3.tar.gz
sudo apt-get install gtk-theme-switch kcontrol
sudo apt-get install checkinstall
cd QtCurve-Gtk1-0.42.2
./configure
make
sudo checkinstall
cd ..
cd QtCurve-Gtk2-0.52.3
./configure
make
sudo checkinstall
cd ..
cd QtCurve-KDE3-0.52.3
./configure
make
sudo checkinstall

When on the checkinstall step, you can enter anything for the description that you want. I use checkinstall rather than “make install” because you can remove the installation clean with apt or Synaptic Package Manager. You never know when someone will be too nasty to include a “make uninstall” method — yes, I’m talking about you, PHP.

Open up Application->Settings->User Interface Settings and set QtCurve as your theme. It will probably look like crap for now. That’s OK.

Next execute “kcontrol,” which starts the KDE control panel. You could use the Qt3 control panel, but it won’t let you configure a font anti-alias that will match your Gtk one, which leaves your Qt applications looking chunky and ugly. You also can’t change the KDE icons to match Gtk’s.

Click the Appearance & Themes tab, then Icons. Pick whichever Icon theme you use in Gtk from this list. Remember, it need to have PNGs. Any theme absent PNGs will not work — that’s why I use Tango.

Next, click Fonts. Make sure to check “Use anti-aliasing for fonts,” and then click the Configure button. Enable sub-pixel hinting and set it to “Full.”

Click on style, and from the list, select QtCurve. Disable everything in the Effects tab, and under Toolbar, enable highlight buttons.

Lastly, click on the colors tab. This is where the magic happens, and you can test it live. Screw with all the settings until your colors look just the way you want. You may need to restart kcontrol to see some of the changes. When you are very happy with how the kcontrol window looks, you will need to log out and log back into your X client or gdm. This is the only way to totally refresh the Gtk engines that I know of.

What QtCurve does is reads Qt’s color settings and applies them live to the Gtk1 and Gtk2 themes. This allows you to get a unified appearance across all applications, provided you aren’t doing too much odd tweaking in KDE.

When you are back in, run “gtk-theme-switch.” This is an incredibly simplistic application, but it gets the job done. Select QtCurve from its list, and immediately, things will look better. The problem is the font — it’s probably huge! Click the icon right of the drop-down to bring up the font settings. You can browse for a font from the list.

Be warned — most fonts are not Gtk1 compatible. It only accepts 1-byte fonts, meaning nothing that includes non-English characters. All your beautiful Bitstream Vera and Deja Vu Unicode fonts are useless here. The old Microsoft Verdana font kind of goes with Bitstream Vera Sans, so you can select that one if you have it. Tweak the size till you see something close to the Gtk2 fonts, and hit OK.

Congratulations! For the first time ever, all your shit on Linux will look the same! Well, everything except Skype, because Skype does not love Linux users.

Update: As I showed in an earlier fix, Ubuntu and its derivatives tend to have issues when they need to apply Gtk themes which do not reside in /usr/share/themes. So what happens when a Gtk theme is pulling live from Qt theme files? Pretty much what you would expect — chaos. Nothing run as root will reflect color changes you set in Qt or kcontrol.

I did two things to fix this, and I’m not sure which worked, so I’ll suggest that you do both.

First off, run “sudo kcontrol” and apply all the same settings you did when you ran it as user. Get the colors to match exactly ad enable font anti-aliasing. Next, copy the contents of your “/~/.qt” folder to “/root/.qt.” Completely reboot your system to make sure every last bit of Gtk is refreshed — just restarting gdm did not do it for me.

After those two step and a hard reboot, everything appears to be running correctly.

Related Posts

Related posts brought to you by Yet Another Related Posts Plugin.


About this entry