The K Desktop Environment

5.3. Using Templates to access Applications and Devices

One of the folders KDE places on your desktop when you log in the first time is called Templates. It holds a number of files with a .kdelnk extension (not shown). These kdelnk files are used to represent the following in KDE:

Nearly every item in the Application Starter and on the panel refers to a kdelnk file on disk. The kdelnk file specifies what icon to display, as well as specific information about what the icon represents (an application, device, or URL). You can drag any kdelnk file to the panel to create a quick-launch button.

5.3.1. Setting up printers

You can create icons for your printers so that you can print a file by dragging it to a printer icon. Here's how:

  1. Open the Templates folder located on the desktop.

  2. Drag the Program icon in the folder to the desktop. Choose Copy from the menu that appears when you drop the icon.

  3. Right click the new icon, and choose Properties from the context menu.

  4. On the General tab, change the name to Printer.kdelnk.

  5. On the Execute tab, enter the following in the first Execute field:

     lpr %f
    Note

    This example assumes that you print using the lpr command. If you use a different command, enter the one you use.

  6. Still in the Execute tab, click the icon that looks like a cog, and select the Printer icon from the list that appears.

Now you should be able to drag a file to the Printer icon and have it printed on your default printer.

5.3.2. Mounting devices

Unix provides access to storage devices other than the primary hard disk through a process called mounting. KDE uses kdelnk files to allow you to easily mount, unmount, and access files on secondary storage devices such as floppy drives and CD-ROM drives.

As an example, here are the steps needed to create an icon to access files on a floppy disk:

Note

Many systems require you to be logged in as root to mount and unmount devices.

  1. Open the Templates folder located on the desktop.

  2. Drag the Device icon in the folder to the desktop. Choose Copyfrom the menu that appears when you drop the icon.

  3. Right-click the new icon, and choose Properties from the context menu.

  4. On the General tab, change the name to Floppy.kdelnk.

  5. On the Device tab, enter /dev/fd0 as the Device.

  6. Click the Unmounted Icon and select the picture of a floppy disk without the green light.

Now, place a properly formatted floppy in the drive and click the Floppy icon to have KDE mount the floppy drive and display the files on the disk. Before removing the disk from the drive, right-click the Floppy icon and choose Unmount from the menu.