# All About Your Desktop

Little Red Riding Hood

Grandma, what big eyes you have!

The Wolf

The better to see you!

The more you see, the more efficiently you can use your desktop. &kde; gives you the opportunity to make the desktop look and work the way you prefer, enabling you to work faster and more productively. It even gives you the opportunity to be warned if a wolf is trying to eat you, or (if you happen to be a granny) alert you when Little Red Riding Hood is on her way to bring you the goodies. Now that's service.

## Autostarting Applications

Native &kde; programs and many third party applications left open at the end of a session will save their state and reappear when you login again, but there are some programs (like some versions of &Netscape;) that will not. You can use the `Autostart` folder for these programs.

To launch programs when &kde; is started, do the following:

1. Open the `Autostart` folder. By default this folder is at `$`HOME`/.trinity/Autostart`

2. Open a &konqueror; window and browse to the program you want to add. If you do not know how to do this, it was covered in the-filemanager-screen.

3. Drag and drop the desired program from the &konqueror; window on to the `Autostart` folder. When asked, choose Link to create a symbolic link rather than a full copy, as this saves a great deal of disk space.

4. Repeat the above steps for every program you want started when &kde; is launched. Remember, you do not need to add native &kde; applications, just leave them open when you log out, and they will open up again as if nothing had happened the next time you log in to &kde;.

5. Restart &kde; if you want to see the autostart function in action.

Your programs should have launched automatically when &kde; restarted.

Do not forget though that you will only need the Autostart folder for a few applications. Many applications, including almost all native &kde; applications, now understand session management, and you can simply leave them open when you log out in order for them to be restarted exactly as you left them. You can leave a &konqueror; window open with your favourite website, &kmail; looking at your inbox, and &kate; with a half dozen files open, log out, log back in, and find your desktop exactly as you left it.

## Adding Programs and Shortcut Icons to Your &kmenu; and Panel

The &kde; &kmenu; and &kicker; are not limited to the setup you find right after installing &kde;. The &kde; panel is designed to be extended, and there are two main ways of doing that: Adding new programs, and adding shortcut icons.

### Adding menu entries

&kde; comes with a great many applications already in the menu. Depending on your operating system and distribution, this could include many non-&kde; applications. &kde; also includes an application that will search your hard drive for more applications, and add them to the menu for you. Try pressing &Alt;F2 and entering `kappfinder` to see it in action — operation is very straightforward.

&kappfinder; is clever enough, but it doesn't know about every application there is. Or perhaps you simply don't want to have all those applications in the menu, and just want to add a single extra program.

To add your favourite programs to the &kde; menu, you can use the KDE Menu Editor. To start it, use the &kmenu; and choose Settings Menu Editor.

A window will open showing the existing &kmenu; on the left, and an empty menu entry dialogue on the right

For this example, we will be adding an entry for the Gimp under the Graphics submenu. If you already have a Gimp entry there and don't want a new one, you can still follow through this example, but just don't click the Apply when you are done.

1. Navigate down the left hand tree to the Graphics entry.

2. Click on it once with the left mouse button to expand the entry.

3. Click the icon labelled New Item in the toolbar, or choose File New Item in the menu bar.

4. In the dialogue box that pops up, enter the name you want your new menu entry to have. For this example, enter `Gimp`.

   Then press OK in the dialogue.

5. Click on the new Gimp menu entry that was created for you under the Graphics submenu. The menu entry dialogue to the right will now change to be mostly empty, except for the name you already gave.

6. Fill in an optional Comment. You might like to put `An image editor` for the example. Text entered here will be shown as a tool-tip in the &kmenu;.

7. Enter in the box labelled Command, the command you would type on the command line to open your application. For this example, this is `gimp`. You may also enter any optional command line parameters if you wish. You can use this to make a menu entry that always opens a particular document or image, for example. Check the application's documentation to find out more about command line parameters.

8. If you want the application to operate from a particular folder (for example, for Gimp to begin its Load Image dialogue in a particular place) enter this path in the box labelled Work Path. This is optional.

9. If you wish to change the icon from the default unknown, click on the icon to the right of the dialogue, to open a standard &kde; icon chooser.

10. Some applications must be run in a terminal window (for example Pine). If this is the case, check the appropriate check box.

11. If you want to run your application as a different user, check the box labelled Run as a different user and enter the appropriate user name in the text box.

12. If you're happy with your menu entry, press Apply. If you would like to start over, press Reset.

And that's all. You now have a new menu entry.

### Shortcut Icons

Although &kde; is much more comfortable than the average &UNIX; window manager, everyone wants a solution for a one-click way to start a program. Later, you will learn how to create links and files on your desktop, but this also has some disadvantages: sometimes all your desktops are filled up with windows, and you cannot reach your icons without minimising all the windows that cover them. For commonly used programs, you can minimise this problem and speed access by creating shortcut icons on the &kde; panel.

To create a shortcut on the &kicker; panel, you have some choices: Drag-and-drop, or via a menu.

### Adding a shortcut icon with the menu

1. Click on the &ticon; and choose Panel Menu Add Application .

2. You will see the top level of the &kmenu; again. Go through the menus to find the entry for which you want to create the shortcut, such as Home folder or &konqueror;. Click on the program you want.

A new icon will appear on the panel. Click on it, and the program will start.

Adding a shortcut icon with drag-and-drop is even simpler - just drag any icon from your desktop, or a &konqueror; window, to an empty space on the panel.

What happens when you drag an item to your panel depends on what kind of item it is:

If you drag a folder...

- A menu will pop up giving you a choice of Add as a File Manager URL or Add as a QuickBrowser. Choosing the first will create an icon that opens a &konqueror; window, starting at this folder, while choosing the latter will open that folder as a menu from the Panel.

If you drag a shortcut from your desktop...

- It will be copied to the panel.

If you drag a document...

- A link will be made on the panel, leaving the original in place. Clicking on the resulting icon will open that document in the default application.

In any case, if you want to move the icon, click on it using the &RMB; and choose Move `Name of Button` Move the icon to the position you want and press the &LMB;. If you wish to remove the icon, click on it using the &RMB; and choose Remove `Name of Button`.

## Creating New Files On Your Desktop

Your desktop can be an efficient place to work. Every time you start &kde;, you can see the complete files, folders and &URL;s which you often use.

There are two ways to create and edit files on your desktop. In any application, you can say that you want to save your work in the Desktop subfolder of your home folder. For example, my home folder is `/home/stupiddog`, so my Desktop folder is `/home/stupiddog/Desktop`. Everything you save there will be put on your desktop.

If you want to move existing files to your Desktop, the best way to achieve this is to use &konqueror;. Open a file manager window and drag the files you need to your desktop. You can choose to copy them if you want to keep all your common stuff on the desktop now, or you can create symbolic links to the real files. Everything you change in the link files will be automatically updated in the originals. For more information on how to use drag & drop and the file manager, see the chapter Moving files with drag & drop.

## Placing Links on Your Desktop

Placing files on your desktop may shorten the paths you need to enter. However, sometimes it would be nice if you could start &kedit; with a commonly edited file already opened in it. And how often do you find yourself frustrated after browsing through endless lists of bookmarks to find a site you visit often? Wouldn't it be nice if everything necessary to deliver you to that site was done automatically after clicking a single icon?

### Using &MIME; Types and File Associations

&MIME; Types are very powerful. Employing them, you can easily customise your system such that clicking on a file of a specific type starts the application with which that file type has been associated. For example, all `.mod` files could be set to start &noatun;, `.html` files could open a &konqueror; window showing the file, and a `core` file can be viewed with the &khexedit; by simply clicking on the `core` file.

Although &MIME; types are very powerful, they are not without dangers. Playing around with &MIME; types as the system administrator (`root`) can damage a &kde; system so severely that it cannot be restarted! In this example, you will create your personal &MIME; style, which is only relevant for you. It will only affect other users if you copy or move it to `$`TDEDIR`/share/mimelnk`.

To link a certain file type with a particular application:

1. Make sure the application you want to start this file type has an entry in the &kmenu;.

2. In &konqueror; find or make a file with the extension you wish to link.

3. Right click on the file, and choose Properties from the context menu and then press the tiny button with an icon next to the Type resulting properties dialogue. Or, choose Edit Edit File Type... in the &konqueror; menu bar.

4. Add file masks for the application by clicking the Add button, and entering the file pattern you want. Remember that &UNIX; is case sensitive, so you may need to add variations - `*.mp3` may need `*.MP3` added as well, for example. Add as many masks as you like in this way.

5. Add a description if you like. This is optional.

6. In the section labelled Application Preference Order, press the Add button. A miniature copy of the &kmenu; will open, where you can choose the application you want files of this type to be opened with.

7. Sometimes, you may want to use a different application to open this file type. For example, you might like to use &kate; to open text files you wish to edit, and &kedit; for text files that you just want to take a quick peek into. You can add more applications in the same way as you did in the last step, and you can change the preferred order using the Move Up and Move Down buttons.

8. If you're satisfied with your choices, you can click the Apply button to save your changes without closing the dialogue box. This gives you the opportunity to test in the &konqueror; window that your file association is correct. You can choose OK to save your changes and close the dialogue box, or Cancel if you have changed your mind and just want to close the dialogue box.

Be sure to try your new association by opening a folder containing a file of the type you just selected. Click on the file, and the program needed to edit it should start.

&MIME; types are a way of describing the contents of files. You may be used to using file extensions for that purpose, and you may know that on &UNIX; systems the file extension often bears little or no relation to the contents of the file. On the other hand, it may be vital - for example, some implementations of `gunzip` won't operate on files that aren't named `.gz`.

&MIME; types naturally make use of filename patterns, but not necessarily the extensions - you can set up any filename pattern you like. For example, if you always want to open any files relating to a particular client with &kate;, and you make a habit of naming the files with the client's name at the beginning so that they naturally group in the &konqueror; window, then you can set up a filename pattern that matches `^`clientname`*`. Then any files that have `clientname` at the beginning (the `^` character means starts with...) will be opened with the application you choose.

## Using the Trash Can

Under normal circumstances, deleting a file under &UNIX; is something which cannot be undone. However, with &kde;, you can choose Move to Trash instead of Delete. This will move the file into the `Trash` Folder, which, by default, is accessible as an icon on your desktop. In the `Trash` Folder, you can always recover deleted files. Remember to empty the trashcan now and then by clicking on it using the right mouse button, then choosing Empty trashcan, otherwise you might run out of disk space because the files still need space. Note, however, that once you empty the `Trash` Folder, the files contained therein are lost forever.