<chapter id="all-about-your-desktop">
<title>All About Your Desktop</title>

<epigraph>
<attribution>Little Red Riding Hood</attribution>
<para>Grandma, what big eyes you have!</para>
</epigraph>

<epigraph>
<attribution>The Wolf</attribution>
<para>The better to see you!</para>
</epigraph>

<para>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. </para>

<sect1 id="the-autostart-folder">
<title>The Autostart Folder</title>

<para>Before I discovered the Autostart folder, my daily startup
routine with &kde; consisted of the following: Start &kde;, start
&kedit;, start &konsole;, start &Netscape;, and start &kscd;. This
took time I could have spent better. Native &kde; programs left open
at the end of a session will save their state and reappear when you
login again, but there are some programs (like &Netscape;) that will
not. You can use the <filename>Autostart</filename> folder for these
programs.</para>

<para>To launch programs when &kde; is started, do the
following:</para>

<procedure>
<step>
<para>Open the <filename>Autostart</filename> folder.  By default this
folder is at <filename
class="directory">$<envar>HOME</envar>/.kde/share/autostart</filename></para>
</step>
<step>
<para>Open a &konqueror; window and browse to the program you want to
add.  If you don't know how to do this, it was covered in <xref
linkend="the-filemanager-screen"/></para>
</step>
<step>
<para>Drag and drop the desired program from the &konqueror; window
on to the <filename class="directory">autostart</filename> folder.
When asked, choose <guimenuitem>Link</guimenuitem> to create a
symbolic link rather than a full copy, as this saves a great deal of
disk space.</para>
</step>
<step>
<para>Repeat the above steps for every program you want started when
&kde; is launched.  Remember, you don't 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;.</para>
</step>
<step>
<para>Restart &kde; if you want to see the autostart function in
action.</para>
</step>
</procedure>

<para>Your programs should have launched automatically when &kde;
restarted. If you want to add something special (e.g., you want to see
a certain web site when your system goes up), read <link
linkend="using-templates">Using templates</link>. The procedures
described there work for any folder, so you can also apply them to
the <filename>Autostart</filename> folder, as well.</para>

</sect1>

<sect1 id="adding-programs">
<title>Adding Programs and Shortcut Icons to Your <guimenu>K menu</guimenu> and
Panel</title>


<para>The &kde; <guimenu>K Menu</guimenu> 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.</para>

<sect2 id="menu-items-add">
<title>Adding menu entries</title>

<para>&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 <keycombo
action="simul">&Alt;<keycap>F2</keycap></keycombo> and entering
<userinput>kappfinder</userinput> to see it in action &mdash;
operation is very straightforward.</para>

<para>&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.</para>

<para>To add your favorite programs to the &kde; menu, you can use
the <application>KDE Menu Editor</application>. To start it, use the
<guiicon>application starter</guiicon> and choose
<menuchoice><guimenuitem>System</guimenuitem><guimenuitem>Menu
Editor</guimenuitem></menuchoice>.</para>

<para>A window will open showing the existing <guimenu>K
Menu</guimenu> on the left, and an empty menu entry dialog on the
right</para>

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

<procedure>
<step><para>Navigate down the left hand tree to the
<guisubmenu>Graphics</guisubmenu> entry.</para></step>
<step>
<para>Click on it once with the <mousebutton>left</mousebutton> mouse
button to expand the entry.</para>
</step>
<step>
<para>Click the icon labeled <guiicon>New Item</guiicon> in the
toolbar, or choose <menuchoice><guimenu>File</guimenu><guimenuitem>New
Item</guimenuitem></menuchoice> in the menu bar.</para>
</step>
<step>
<para>In the dialog box that pops up, enter the name you want your new
menu entry to have.  For this example, enter
<userinput>Gimp</userinput>.</para><para>Then press
<guibutton>OK</guibutton> in the dialog.</para>
</step>
<step>
<para>Click on the new <guimenuitem>Gimp</guimenuitem> menu entry that
was created for you under the <guisubmenu>Graphics</guisubmenu>
submenu.  The menu entry dialog to the right will now change to be
mostly empty, except for the name you already gave.</para>
</step>
<step>
<para>Fill in an optional <guilabel>Comment</guilabel>.  You might
like to put <userinput>An image editor</userinput> for the example.
Text entered here will be shown as a tool-tip in the
<guimenu>Application Starter</guimenu></para>
</step>
<step>
<para>Enter in the box labeled <guilabel>Command</guilabel>, the
command you would type on the command line to open your application.
For this example, this is <command>gimp</command>.  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.</para>
</step>
<step>
<para>If you want the application to operate from a particular
directory (for example, for <application>Gimp</application> to begin
it's <guilabel>Load Image</guilabel> dialog in a particular place)
enter this path in the box labeled <guilabel>Work Path</guilabel>.
This is optional.</para>
</step>
<step>
<para>If you wish to change the icon from the default
<quote>unknown</quote>, click on the <guiicon>icon</guiicon> to the
right of the dialog, to open a standard &kde; icon chooser.</para>
</step>
<step>
<para>Some applications must be <guilabel>run in a terminal</guilabel>
window (for example <application>Pine</application>).  If this is the case,
check the appropriate check box.</para>
</step>
<step>
<para>If you want to run your application as a different user, check
the box labeled <guilabel>Run as a different user</guilabel> and
enter the appropriate user name in the text box.</para>
</step>
<step>
<para>If you're happy with your menu entry, press
<guibutton>Apply</guibutton>.  If you would like to start over, press
<guibutton>Reset</guibutton>.</para>
</step>
</procedure>

<para>And that's all.  You now have a new menu entry.</para>

</sect2>

<sect2 id="icons-add">
<title>Shortcut Icons</title>

<para>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 minimizing all the windows that cover them. For commonly used
programs, you can minimize this problem and speed access by creating
shortcut icons on the &kde; panel.</para>

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

<procedure>
<title>Adding a shortcut icon with the menu</title>
<step><para>Click on the <guiicon>application starter</guiicon> and choose
<menuchoice><guisubmenu>Panel
Menu</guisubmenu><guisubmenu>Add</guisubmenu><guimenuitem>Application</guimenuitem>
</menuchoice>.</para></step>
<step><para>You will see the top level of the <guimenu>application
starter</guimenu> again. Go through the menus to find the entry for which you
want to create the shortcut, such as <guimenuitem>Home directory</guimenuitem>
or &konqueror;. Click on the program you want.</para>
</step>
</procedure>

<para>A new icon will appear on the panel. Click on it, and the program will
start.</para>

<para>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.</para>

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

<variablelist>
<varlistentry>
<term>If you drag a directory...</term> <listitem><para>A menu will
pop up giving you a choice of <guimenuitem>Add as a File Manager
URL</guimenuitem> or <guimenuitem>Add as a QuickBrowser</guimenuitem>.
Choosing the first will create an icon that opens a &konqueror;
window, starting at this directory, while choosing the latter will
open that directory as a menu from the Panel.</para></listitem>
</varlistentry>

<varlistentry>
<term>If you drag a shortcut from your desktop...</term>
<listitem><para>It will be copied to the panel.</para></listitem>
</varlistentry>

<varlistentry>
<term>If you drag a document...</term>
<listitem><para>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.</para></listitem>
</varlistentry>
</variablelist>

<para>In any case, if you want to move the icon, click on it using the
<mousebutton>right</mousebutton> mouse button and choose
<guimenuitem>Move.</guimenuitem> Move the icon to the position you
want and press the <mousebutton>left</mousebutton> mouse button.  If
you wish to remove the icon, click on it using the
<mousebutton>right</mousebutton> mouse button and choose
<guimenuitem>Remove</guimenuitem>.  You can also move the icon by
clicking with the <mousebutton>middle</mousebutton> mouse button, and
dragging it to it's new location.</para>

</sect2>
</sect1>

<sect1 id="creating-new-files-on-your-desktop">
<title>Creating New Files On Your Desktop</title>

<para>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.</para>

<para>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 directory.  For example, my home
directory is <filename class="directory">/home/stupiddog</filename>,
so my Desktop directory is <filename
class="directory">/home/stupiddog/Desktop</filename>. Everything you
save there will be put on your desktop.</para>

<para>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 &amp; drop and the file manager,
see the chapter <link linkend="moving-files-with-drag-and-drop">Moving
files with drag &amp; drop.</link></para>

</sect1>

<sect1 id="using-templates">
<title>Placing Links on Your Desktop</title>

<para>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?</para>

<sect2 id="using-mimetype">
<title>Using Templates</title>

<para>Templates provide a convenient mechanism for performing tasks
such as those outlined above.  Templates can also be used to associate
particular file extensions with a specific application.  When a file
ending in a known extension is double-clicked, the application
associated with that extension is automatically started.  In short,
<emphasis>templates</emphasis> help you get the most out of
&kde;.</para>

<para>Example: You want to put an icon for visiting the &kde; web site
on your desktop.</para>

<procedure>
<step><para><mousebutton>Right</mousebutton> click on an empty space in the
desktop.</para></step>
<step><para>Choose <menuchoice><guisubmenu>Create
new</guisubmenu><guimenuitem>Internet Address (URL)</guimenuitem></menuchoice>
from the context menu.</para></step>
<step><para>A dialog box will open where you can type in the address you are
making a shortcut to.</para></step>
<step><para>A new icon will be created on your desktop.</para></step>
</procedure>

<para>Your new Internet shortcut can be customized like any other
shortcut icon.  <mousebutton>Right</mousebutton> click on the icon and
choose <guimenuitem>Properties</guimenuitem>, and you can change the
icon, or the name of the shortcut as you wish.</para>

</sect2>
<sect2>

<title>Using &MIME; Types</title>

<para>&MIME; Types are very powerful. Employing them, you can easily
customize 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 <literal role="extension">.mod</literal> files could
be set to start &noatun;, <literal role="extension">.html</literal>
files could open a &konqueror; window showing the file, and a
<filename>core</filename> file can be viewed with the &khexedit; by
simply clicking on the <filename>core</filename> file.</para>

<warning>
<para>Although &MIME; types are very powerful, they are not without
dangers. Playing around with &MIME; types as the system administrator
(<systemitem class="username">root</systemitem>) can damage a &kde;
system so severely that it cannot be restarted! In this example, you will
create your <emphasis>personal</emphasis> &MIME; style, which is only
relevant for you. It will only affect other users if you copy or move
it to <filename
class="directory">$<envar>KDEDIR</envar>/share/mimelnk</filename>.</para>
</warning>

<para>To link a certain file type with a particular application:</para>

<procedure>

<step><para>Make sure the application you want to start this file type
has an entry in the <guimenu>K menu</guimenu>.</para></step>

<step><para>In &konqueror; find or make a file with the extension you
wish to link.</para></step>

<step><para><mousebutton>Right</mousebutton> click on the file, and
choose <guimenuitem>Edit File Type</guimenuitem> from the context
menu, or choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Edit
File Type</guimenuitem></menuchoice> in the &konqueror; menu
bar.</para></step>

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

<step><para>Add a description if you like.  This is
optional.</para></step>

<step><para>In the section labeled <guilabel>Application Preference
Order</guilabel>, press the <guibutton>Add</guibutton> button.  A
miniature copy of the <guimenu>Application Starter</guimenu> menu will
open, where you can choose the application you want files of this type
to be opened with.</para></step>

<step><para>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 <guibutton>Move Up</guibutton> and
<guibutton>Move Down</guibutton> buttons.</para></step>

<step><para>If you're satisfied with your choices, you can click the
<guibutton>Apply</guibutton> button to save your changes without
closing the dialog box.  This gives you the opportunity to test in the
&konqueror; window that your file association is correct.  You can
choose <guibutton>OK</guibutton> to save your changes and close the
dialog box, or <guibutton>Cancel</guibutton> if you have changed your
mind and just want to close the dialog box.</para></step>
</procedure>
  
<para>Be sure to try your new association by opening a directory
containing a file of the type you just selected. Click on the file,
and the program needed to edit it should start.</para>

<note>
<para>
&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 bear little or no
relation to the contents of the file.  On the other hand, it may be
vital - for example, some implementations of <command>gunzip</command>
won't operate on files that aren't named <literal
role="extension">.gz</literal>.
</para>

<para>
&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
<literal>^<replaceable>clientname</replaceable>*</literal>.  Then any
files that have <replaceable>clientname</replaceable> at the beginning
(the <literal>^</literal> character means <quote>starts
with...</quote>) and without any regard to the rest of the filename.
</para>
</note>
</sect2>

</sect1>

<sect1 id="using-the-trashcan">
<title>Using the Trash Can</title>

<para>Under normal circumstances, deleting a file under &UNIX; is
something which cannot be undone. However, with &kde;, you can choose
<guimenuitem>Move to Trash</guimenuitem> instead of
<guimenuitem>Delete</guimenuitem>. This will move the file into the
<filename class="directory">Trash</filename> Folder, which, by
default, is accessible as an icon on your desktop. In the <filename
class="directory">Trash</filename> 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 <guimenuitem>Empty
trashcan</guimenuitem>, otherwise you might run out of disk space
because the files still need space. Note, however, that once you empty
the <filename>Trash</filename> Folder, the files contained therein are
lost forever.</para>

</sect1>
</chapter>
