KDE4

= KDE Userbase =

A source of extensive documentation is http://userbase.kde.org/

= Trying out KDE4 without installing =

The Gentoo LiveDVD has KDE4. Burn yourself a disk and try KDE4 out without altering your current Gentoo setup. ISO files can be downloaded from ftp://ftp.df.lth.se/pub/gentoo/releases/amd64/ or ftp://ftp.df.lth.se/pub/gentoo/releases/x86/ (choose the latest 10.* release). More info here.

= Installing =

Since October 2009 KDE4 is the default when emerging kde-meta or kdebase-meta

= Configuration =

KDE4 is highly configurable. This section describes some configuration steps that you may want to try out.

Application Launcher Menu style
The Application Launcher Menu, similar to the Start menu in Microsoft operating systems, can have two styles. "Kickoff" is the default style, and "Classic" is a style that has been around ever since Windows 95. To switch between the two, unlock widgets then menu-click the K button and do "Switch to Xxx Menu Style".

A Show Desktop button
Emerge the kde-base/kdeplasma-addons package. Click the "cashew" of the panel. Click "Add widgets...". Select the Show Desktop widget and click "Add Widget".

Adjusting the thickness of a panel
Click the cashew. A toolbar pops up. Click the "Height" (or "Width") button but DO NOT RELEASE the mouse button. Now move the mouse, this causes the width of the panel to grow or shrink. When done, click the [x] of the toolbar.

Moving a panel to another screen edge
Similar to the previous recipe, just use the "Screen edge" button instead. Move the mouse pointer WITHOUT RELEASING to the desired screen edge.

Configuring the looks of buttons in the Task Manager
''Perhaps there isn't a lot that can be done. For example, in KDE3.5 you can have a vertical edge Task Manager where the buttons are quite small but still usable. In KDE4 the buttons take up much more vertical space, and the embedded icon tends to get very small if the width of the panel is made small. Any ideas?''

Rearranging widgets within a panel
To move widgets around in the panel, choose 'Panel Settings'. While the Settings window is opened, move the cursor to the widget on the panel, click on it and move to the desired location. Close the Panel Settings window after the move.

Change KDM settings
To be able to change most KDM settings you need to run it with root access. Press Alt-F2 and enter "kdesu systemsettings".

Classic style
By applying selected configuration recipes you can make KDE4 a bit more similar to KDE3.5. These recipes are:


 * Application Launcher Menu style set to Classic
 * Add a Show Desktop button to the panel
 * Choose 'classical tree view' in configuration of the SystemSettings. One may also wish to unselect "Show detail tooltips", which will eliminate often overlapping tooltips at the directory (although not at the leaf) level in the tree.
 * SystemSettings->Look&Feel->Desktop->DesktopEffects, untick "Enable Desktop Effects"
 * If one insists on more visual similarity, one can choose Plastique style both for widget (System Settings -> Look & Feel -> Appearance -> Style) and windows (System Settings -> Look & Feel -> Appearance -> Windows) decorations.

Adding panel menus
Here is a recipe for adding menus to a KDE4 desktop panel.

You need to create a directory for each panel menu. It is convenient (but not necessary) to create an overall directory to hold the menu directories. For example, you could do the following in your home directory:

$ mkdir Panel_Menus $ cd Panel_Menus $ mkdir WWW $ mkdir Office

The WWW directory might include browser and mail applications. The Office directory might include editors and PDF readers. The directory names can be anything that you want; you don't have to use these names. Leave the menu directories empty for now.

The most reliable way to create and edit the menus seems to be to use dolphin. Hence, if you don't have dolphin on your computer, emerge it and, then, start it:

$ emerge dolphin $ dolphin

"Places" are important directories on your computer such as "Home" and "Root." Your menus will be "Places." The "Places" panel is found on the left of the dolphin window. Right click in the empty space below the existing "Places." Click the "Add Entry" button that appears. A dialog window should appear. Enter the name of one of your menu directories in the "Description" blank. Then, click the browser button and find and enter the location of that directory. Next, left click on the icon in the middle of the dialog window and choose an icon for your menu. It doesn't have to be a Places icon; you can use any icon found on your computer. (The icons on your computer have a ".png" suffix.) Then, deselect the "Only show ..." setting in the dialog, i.e., remove the check mark. Finally, click OK. Your menu directory will now be one of the "places" in the dolphin Places panel.

Next, left click on that new menu directory icon. Right click in the (currently empty) work area that is now the middle of the dolphin window. Select "Create New," then, "Link to Application...." Click the Application tab in the dialog that appears and fill in a name for an application that you want to add to your menu. Put the command that starts the application in the Command blank, for example, "konqueror." You can fill in the other blanks if you want. Then click OK.

An icon labeled "Link to Applicatio..." should now be in the dolphin work area. Right click that icon and select "Rename...." Enter the label that you want to appear for this application in your menu's application list. Click "Rename." A new icon with your label is now in the work area. (The previous icon may still be there but ignore it. It will go away.)  Right click the new icon and select "Properties." Click the large icon on the upper left of the window that appears and select an icon for this application. Click OK. (There will now be a text file in the menu directory that you created above for this application.)

Repeat the above instructions to add additional applications to your menu.

Next, click the cashew on the right of the desktop panel, then click "Add Widgets...," then select the "Folder View" widget. Click the "Add Widget" button at the bottom of the window. Then, click "Close." A new icon will now be in the panel on the right. Right click that icon and, then, click "Folder View Settings." In the dialog window that appears, select the "place" that you have just configured in dolphin. Click OK.

Your menu widget is now in the panel. You can move its location in the panel as described elsewhere in this article.

Test the menu to make sure it works.

Repeat this process to add more menus.

In the future, you can edit the menus, e.g., to change a label or an icon, using Dolphin. You can also add and edit menu applications by right clicking the menu icon. However, this latter route has been buggy in the past. You may have to reboot before the change appears in the panel menu.

Printing the konsole window
Unlike the "konsole" in KDE3, the "konsole" in KDE4 has no print command. The print command had been a quick way to print an error that appeared in a konsole window or to print the result of some command. Supposedly, one can achieve the same result in KDE4 by starting an application like "kate," copying the contents of the konsole window to the kate window, optionally editing that content, printing it, and then closing kate.

A easier way to print the contents of konsole is to use xclip. xclip enables you to manipulate the contents of the X11 clipboard. In particular, the following command will print the text that is highlighted in konsole:

xclip -o | fold -s -w 100 | lpr

The "fold" command limits the length of lines (to 100 characters in this example) and tries to break lines at spaces, if possible.

There are some advantages to using xclip over the old konsole print command. You can select the text you want to print; you don't have to print the entire window. You can often print more than the text that is visible in the konsole window by moving the mouse cursor to the top or bottom of the window and letting the window scroll. (This doesn't work if an application like an editor is running in the konsole window.) And xclip works with any text that you can highlight, e.g., in editors, in browsers, and in email applications.

xclip is in portage; hence, "emerge xclip" will install xclip on your computer.

You may have to add options to the "lpr" command, e.g., page margins, printer destination, etc., if they are not already set up on your computer. You can also set the options using the "lpoptions" command. Available options are listed here: http://localhost:631/help/options.html?TOPIC=Getting+Started&QUERY=.

You can make the above xclip command a clickable desktop or panel icon by: You can change the icon image by right clicking it, selecting "Icon Settings," clicking the large icon, and selecting a more suitable icon.
 * Right clicking the Application Launcher Menu icon usually at the lower left on your display.
 * Clicking Menu Editor
 * Clicking New Item
 * Filling in a name for the icon, e.g., xclip
 * Putting the above xclip command in the Command blank.
 * Clicking Save
 * Exiting the Menu Editor
 * Left clicking the Application Launcher Menu icon
 * Right clicking the application that you just added.
 * Selecting "Add to Desktop" or "Add to Panel"

= Fonts =

Font configuration is perhaps the one area where users of Microsoft operating systems have an easier life. However, most problems can be solved on KDE4/Gentoo, it just takes some configuration effort.

Some people are happy with antialiased (blurry edges) fonts. Others prefer non-antialiased (sharp but ragged) fonts. These recipes deal with both preferences where relevant.

= Staying with KDE3.5 =

NOTE: If you have run into problems where KDE 3.5 will not start, complaining that libjpeg.so.62 is missing, look here for how to fix it: HOWTO fix libjpeg.so.62 problems

This Gentoo forum thread discusses how to do it.

Among other things it links to a HOWTO page which takes you through the necessary steps.

Emerging any application from the official tree which requires KDE4 or has the use flag will try to pull in KDE4. You can remove all optional dependencies on KDE4 by unsetting the use flag - either system wide in  or on a per-package basis in. See the Gentoo Handbook for more details.

There is an older forum thread on the subject (probably outdated by now; it does not mention the kde-sunset overlay).

= Troubleshooting =

Java Applications are crashing KDE
This problem seems to be solved with KDE 4.3.3!

With the use of proprietary nvidia drivers and KDE4 java applications tend to crash KWin the KDE window manager. Deactivating composite seems to produce less crahes but is still unusable. It seems that the tray activity of java programs is somehow causing it, so the workaround is to deactivate the system tray during start of the application. Once its started the system tray can be activated again. This helps at least with JDownloader 0.9.310 which became unusable with KDE 4.3.1.

More information:  I managed to reproduce this problem and tracked it down to a pair of bugs, one in the X server, and one in one of the X clients involved (probably KDE4's panel program).

This rogue X client sends an invalid XGetImage request, attempting to read outside the bounds of a pixmap. This isn't supposed to be allowed by the X server, but due to Bugzilla #22804, is. The server then sends this invalid request to the driver, which passes it on to the hardware, which triggers an error.

I'll add a workaround to the driver, but both the X server and the broken X client should still be fixed. Source

KDM & ConsoleKit
If you emerged with the  USE flag enabled, you'll need to make sure consolekit is running when you login. It's good practice to add consolekit to the default runlevel:

On a already running system, start consolekit:

And then restart KDM (with the xdm init script);

You should now be able to login through KDM.

Compositing is slow in KDE 4.4 (testing)
Edit ~/.kde4/share/config/oxygenrc and add or change the following line to the [Windeco] block: ~/.kde4/share/config/oxygenrc Source

KDE SC 4