Published on Maximum PC (http://www.maximumpc.com)


How to Customize Your Linux Desktop - From GTK to Compiz
Created 06/26/2009 - 7:30am

Maximum IT
    • IBM Still Dominating Green500 List
    • EU Extends Oracle-Sun Deadline
    • Oracle and SpringSource Launch "Project Gemini"

    Sponsored
SEE MORE MAXIMUM IT
News
  • Roku Opens Channel Store, Disappoints with No Hulu
  • Symantec Says IE Vulnerable to New Exploit
  • Microsoft Offers to Pay News Corp to "De-List" From Google
  • Intel Wants to put a Chip in Your Brain
  • Magic Mouse Drivers For Windows Emerge
SEE MORE NEWS
Features

How to Customize Your Linux Desktop - From GTK to Compiz

Posted 06/26/09 at 10:30:00 AM  by Will Kraft

comment Commentsprint Printemail EmailDeliciousDiggStumbleUponRedditFacebookSlashdot

The days of ugly Linux desktops are a thing of the past. Modern distros include many tools and options that enable them to look good and be more useful.

Unlike Windows, Linux has several different widget toolkits. The most well-known widget engines are GTK+, (distributed with GNOME) and QT. (pronounced “cute”) Widgets are the various elements which make up a program's GUI: scrollbars, arrows, checkboxes, etc. However, take note that QT or GTK widgets are not the same thing as desktop widgets.

 

Widgets and other things like window chrome (the toolbars, panels, etc. of a programs interface) and window decoration (the window's title bar, minimize/maximize/close buttons, and the window border) are the various elements that, when joined together, create a theme for QT or GTK. It is possible to modify the various themes in Linux to change how they look or even create your own. This article will address the various resources that are out there to help make your desktop look its best and help you get the most out of it.

Manipulating GTK Themes

GTK themes are among the most versatile when it comes to customization. Originally created for the GIMP, (GNU Image Manipulation Program) GTK is used in many applications, especially in the GNOME desktop environment. Some of the more elaborate GTK themes use rasterized PNG graphics to create the visual appearance of the widgets, but most GTK themes use effects created by the GTK engine itself. Each installed GTK theme is stored in its own folder in /usr/share/themes and has a gtkrc file that is used to store the parameters of the theme, such as element colors, size, position, etc. Although gtkrc files are plain text and are therefore human-readable, there is still a small learning curve in relation to working with them.

Fortunately, GNOME's Appearance module has a built-in tool to allow you to create your own themes in an easy-to-use interface. (To access the Appearance module in GNOME, go to System → Preferences → Appearance → Customize) This tool uses themes that have already been installed and allows you to mix and match parts from different themes to create your own hybrid designs; you can use icons from one theme, widgets from another, window decorations from yet another, etc. The more themes you have installed, the more versatile this tool can be, since the possible number of combinations can rise exponentially if you install only a few extra themes. For this reason, it is a good idea to install as many themes as possible, since each theme (even ones you don't like) can provide a larger inventory of spare parts to work with.

 

This tool is best for those who don't know how to work with gtkrc files directly or don't want to spend too much time creating their own theme. If you're more artistically inclined, you may wish to create your own themes from scratch. Since themes can be image-based, you are limited only by your creativity. A good way for beginners to learn how to create themes is to download a few and then analyze them to see how other artists made theirs. By using pre-existing themes as a guide, you can then create one of your own.

Plasma Themes

Unlike GTK themes, Plasma themes used in KDE4 are predominately made up of scalable vector graphics. (SVG) These are made in vector graphics editing software like Inkscape, Karbon, or anything else that can export SVG. (even Adobe Illustrator)

 

KDE4's appearance management system is much less straightforward than GNOME. While GNOME has one interface module to control its appearance, KDE4 has several. The modules which allow you to switch between themes is located on the desktop right-click menu instead of the control center, so newbies may be confused at first about how to switch between different themes.

 

Most Plasma themes are quite simple, (mostly glass-like with a few minimalistic and metallic variants) and only affect desktop widgets, the taskbar, etc. Windows are not affected by the Plasma theme you use, since they are not part of the Plasma system. Rather, window appearance is governed through choosing a color scheme and a widget/window decoration style just like in classic KDE. This is done through the Appearance module in the KDE4 control center and is rather straightforward. KDE has a built-in tool to acquire new wallpapers, Plasma themes, etc. so adding additional Plasma themes is simple.

 

Next, how to troubleshoot some common theme-related problems. 


 Dealing with Common Theme-related Problems

Since most programs are set up to use light-colored themes, you may encounter problems if you use a dark-colored or otherwise unusual theme. OpenOffice.org in particular has an annoying bug where the toolbar icons will switch to a rather awful-looking high-contrast icon pack without asking you when a dark theme is detected by the program. If the high-color icon pack is not installed, (as it seldom is out of the box) Openoffice.org will display text instead of icons, which looks even worse and is very space-inefficient. Fortunately, this problem can be easily dealt with.

The easiest way to rectify this problem is to change the icon pack in the OpenOffice.org configuration. (this is done through Tools → Options → View in OpenOffice.org) If the first method fails to work, there is a way to trick OpenOffice.org into using the icon set you want to use. OpenOffice.org stores its icon graphics in zip files, which makes them very easy to manage. These icon packs are buried rather deeply in the filesystem, so they can be difficult to find. Ubuntu stores them in /usr/lib/openoffice/share/config/, but the location varies from distro to distro. 

To fix the dark theme bug, all you must do is rename the icon pack of your choice (like images_human.zip) to “images_hicontrast.zip”. You should replace “images_hicontrast.zip” if it exists. After applying this fix and re-starting OpenOffice.org, OpenOffice.org will think it is using high-contrast icons, but it will actually be using the icon set you want to use and icons will look the way you want them to.

Sometimes, websites use stylesheets that conflict with your system colors, particularly if you use a dark theme with white text. Many stylesheets set a certain background color on form elements and neglect to set a particular text color. Quite often, this results in white or light-colored text on a light background, since system colors are used for any attributes not defined by stylesheets. Although you can configure Firefox to use system colors for web elements, this solution is often too imprecise and makes most websites look ugly. Fortunately, there is a better way.

One of Firefox's greatest strengths is its sheer hackability. Firefox has general settings in its about:config section that allow you to fine-tune the browser's performance and configuration, but Firefox can also be customized very precisely on a per-user basis. Each Firefox profile has its own userContent.css file. (not to be confused with userChrome.css, which is used to manipulate the Firefox GUI itself) userContent.css does not exist by default and must be created in ~/.mozilla/firefox/[your_profile_name]/chrome. Fortunately, Firefox provides a template to start with for both userContent.css and userChrome.css. userContent.css is used to declare rendering guidelines on either a global basis or for specific websites.

If you are using an unusual color scheme, you are able to use userContent.css to force Firefox to override a site's stylesheet in favor of your own preferences. As the extension suggests, userContent.css is just like any other cascading style sheet, but it does have a few Firefox-specific differences. If you have any CSS experience at all, you should not find it too difficult to configure userContent.css. (If you are new to CSS, it is easy to learn and rather straightforward) If you run into problems, there are many online guides that cover the differences between userContent.css and standard CSS in detail in addition to the many CSS tutorials out there.

Desktop Compositing

Many operating systems have shifted from using software rendering for desktop effects, instead opting for 3d-accelerated desktop effects. Linux has offered compositing features for years, starting with the original Compiz Quinn, followed by Beryl. Those two projects have culminated in Compiz Fusion, which is discussed in-depth in this section.

Compiz Fusion Overview

GNOME and KDE 3 have built-in interfaces to use Compiz Fusion, a desktop compositing tool and window manager that is a drop-in replacement for the Metacity Window manager in GNOME and the old Kwin window manager in KDE 3.5. KDE4 has its own compositing engine, but Compiz Fusion is able to override it. Compiz Fusion is a descendant of and replacement for Beryl, a compositing manager that was popular several years ago. Beryl was originally a fork of the original Compiz Quinn project; both projects are now obsolete.

 

Compiz Fusion uses your computer's 3d-acceleration capabilities to produce special visual effects that conventional software-driven graphics are not able to match. The extra burden of rendering these effects is shifted to the GPU on your graphics card or chipset (which would otherwise be idle) instead of the main CPU that is used for everything else. Because of this, you need to make sure your graphics card or chipset is supported in Linux and there is a driver for it if necessary if you want Compiz Fusion to work. (Nvidia support is very good from our experience) Compiz Fusion runs with very little overhead and does not slow down old or low-end machines.

 

Compiz Fusion can do much more than Windows Vista's “Aero” compositing engine. Although GNOME and KDE 3.5 include several presets on some distros, (notably Ubuntu) Compiz can be fine-tuned with the Compiz Config Settings Manager. (CCSM) CCSM can be invoked either through your favorite desktop environment/window manager's menu system or by typing “ccsm” into a terminal. (assuming that CCSM is installed)

Working with Compiz Fusion

CCSM gives you the full scope of effects that the Compiz Fusion engine is capable of. It can replicate all of the features that are in Vista's Aero, and Compiz still has plenty of unique features of its own that have been inherited from Beryl and the original Compiz. Many people have the misconception that Compiz Fusion is merely eye-candy that is meant to “wow” and impress new users. Although there is a grain of truth to that, it is not fair to over-generalize. While some of Compiz's functionality is purely decorative, (and can be way over the top if you use all of it at once) some of it is meant to compensate for certain disabilities or to help make using your computer easier.

 

For instance, the ADD helper tool can help those afflicted with the disorder by dimming all windows except the current active one to minimize distraction and to make the task at hand easier to focus on. Likewise, the magnifier tool makes text easier to read on programs that do not support dynamic text zooming and the negative tool can make some interfaces easier to read by inverting the colors. All of these effects could not be easily implemented through conventional software acceleration without slowing the computer down significantly.

 

On distros like Ubuntu, Compiz Fusion is installed by default but must be activated manually once the requisite video card drivers have been acquired. To enable Compiz Fusion in GNOME, go to System → Preferences → Appearance → Visual Effects and select the preset level you want or use CCSM to configure the desired effects. (CCSM is not required to use the presets in GNOME's Appearance module)


Emerald Overview

Although Compiz Fusion renders the actual windows and controls their behavior effects, you are still stuck with the original GNOME/KDE window decorations by default. However, there is a window decorator program called Emerald that allows you to use better-looking window decorations. Emerald was originally designed to work with Beryl, hence the naming trend; the gemstone emerald is technically a variety of Beryllium. Emerald has been around for awhile, but it still works as a drop-in replacement for the standard Window decorator in GNOME or KDE.

Emerald uses “theme” files to produce window decoration effects. These themes each use an engine that specializes in a different effect (e.g. TruGlass for transparency effects and Vrunner for gradients) Each theme is built around a specific engine; this is a factor to consider when constructing your theme since switching engines can produce vastly different effects.

 

 

If you want to use Emerald, you must install it manually. Fortunately, Ubuntu and many other distros have Emerald in their repositories; Ubuntu users need only type “sudo apt-get install emerald” to install Emerald. By default, Compiz Fusion will not use Emerald; you must manually invoke it through CCSM in the “window decorations” module. To do this, locate the “command” field in the window decoration module and replace the original value with “/usr/bin/emerald --replace”. The changes should take effect at the next login. You can invoke the changes immediately by opening a terminal and running “nohup emerald --replace” after re-configuring CCSM to use Emerald with the previous command.

 

To avoid problems, make sure you have at least one Emerald theme installed before you enable Emerald in Compiz Fusion. If you try to use Emerald without any themes, no window decorations will be rendered at all.

Creating Emerald Themes

If you just want to use other people's Emerald themes, there is an abundance of them at gnome-look.org. To install a theme, extract the .emerald theme file you wish to install from its tarball to a location in your home folder and click the “import” button in the Emerald program interface. Locate the file you extracted, select it, and then click “open” to install it. Emerald provides a list of installed themes; to switch to a theme, click on its entry in the main list.

 

The Emerald program also has a built-in interface for creating themes. Although the feature is called “Edit Theme” it can do far more than that. Once you understand how Emerald handles various graphics, it is possible to create new ones from scratch while using pre-existing ones as a reference. You do not need to include effects like drop shadows or glow in the image components of your theme, since Emerald is capable of generating such things dynamically.

 

 


Desktop Widgets

In recent years, Widgets have become standard fare in all modern operating systems, although they take different forms depending on the operating system in question. (OS X has the Dashboard while Vista has the Sidebar) Linux also features multiple widget engines for multiple desktop environments to fill space on the desktop that would otherwise be wasted. This section will discuss the various theme engines that are available for Linux and what each of them can do. 

Screenlets

GNOME's only real widget system (aside from various things that can be placed on the GNOME panels) is an external program called Screenlets. As far as widgets go, the Screenlets program is very decent. It has a wide variety of widgets available out of the box, with multiple calendars, clocks, system monitors, email checkers, RSS readers, etc. to choose from. From our experience, the Screenlets program is the best widget system available for Linux since the Widgets work equally well on GNOME, KDE and many other window managers.

In Ubuntu, the Screenlets Manager can be installed by running “sudo apt-get install screenlets”. The Screenlet manager software also allows you to install additional screenlets; (most are located on Linux resource sites like gnome-look.org) these must be extracted to your home folder and be placed in the “.screenlets” directory.

Plasma Widgets

The widget system in KDE4 is rather unique. KDE4 was originally meant as a reinvention of the traditional desktop concept; virtually everything (including any desktop shortcut icons) is made out of individual entities called plasmoids that are directly integrated with the new Plasma rendering system. This is a radical departure from other widget systems mentioned in this article, since those are essentially programs that run on top of another desktop environment without actually being part of it.

Plasma widgets are simple to use. To add widget plasmoids to your desktop, right-click anywhere on the desktop in KDE4 and choose the “Add Widgets” option. Many distros include only a few widgets out of the box, but more are available. (KDE4 includes a built-in tool for acquiring new widgets, wallpapers, etc.) However, the selection is not as diverse as Screenlets or SuperKaramba, but this is only because KDE4 is still fairly new. Given time, this deficiency should resolve itself.

If KDE4 is present, nothing else needs to be installed to be able to use KDE4 widgets. KDE4 widgets are not available in any other desktop environment.

SuperKaramba

SuperKaramba saw most of its use several years ago, and still serves as the widget engine for older versions of KDE. SuperKaramba is a remake of Karamba, an even older widget engine. SuperKaramba took Karamba's foundation and added additional features to make widgets easier to use (the original Karamba had no GUI and no easy way to add new widgets)

Due to its age, SuperKaramba has plenty of widgets for every conceivable purpose, and many of them can be found at KDE-oriented resource sites like KDE-look.org. SuperKaramba is best used in older versions of KDE, since KDE4 has its own built-in widget engine and GNOME is not able to handle transparency in SuperKaramba widgets very well. Furthermore, the Screenlets program has the capability to use SuperKaramba widgets, although that feature is still in beta.

 

 

COMMENTS:13
TAGS: Software, linux, gui, features, gnome, gtk, kde4, compiz fusion
COMMENTS
  • Login or register to post comments
  • Technology News

  • Computer Cooling Fans

  • Computer Cases

  • PC Game Controllers

  • PC Games

  • Computer Hardware

  • Headphones

  • MP3 Players

  • Stream Video

  • Computer Mouse

  • Monitors

  • Motherboards

  • NAS Storage

  • Networking

  • Laptop Computers

  • DVD Burner

  • Digital Cameras

  • Portable Storage

  • Computer Accessories

  • Smartphone

  • Antivirus Software

  • Sound Cards

  • Speakers

  • Computer Systems

  • Thumb Drives

  • Video Cameras

  • Video Card Reviews

  • Water Cooling

  • Gadgets

  • Keyboards
  • Contact Us
  • Advertising
  • Privacy Policy
  • Terms & Conditions
  • RSS Feeds
  • TechBlips
  • PCHardwareBlips
  • Site Map
  • Customer Service
Future © 2009 Future US, Inc. All Rights Reserved.

Source URL: http://www.maximumpc.com/article/features/how_customize_your_linux_desktop_gtk_compiz

Links:
[1] http://www.maximumpc.com/user/author1
[2] http://dl.maximumpc.com/galleries/linuxgui/Screenshot.png
[3] http://dl.maximumpc.com/galleries/linuxgui/plasma-theme-carbon.png
[4] http://dl.maximumpc.com/galleries/linuxgui/plasma-theme-oxygen.png
[5] http://dl.maximumpc.com/galleries/linuxgui/missing-oo-icons.png
[6] http://dl.maximumpc.com/galleries/linuxgui/screenlets.png
[7] http://www.maximumpc.com/article/features/the_complete_beginners_guide_linux
[8] http://www.maximumpc.com/article/howtos/how_to_turn_your_linux_rig_a_streaming_media_center
[9] http://www.maximumpc.com/article/howtos/how_to_become_a_linux_netbook_poweruser