The KFM ressource file is named .fmrc
and can be found in
~/.kde/config/.kfmrc
. It should contain some lines you really
need to run KFM. The following entries are a must
[Templates] Path=$HOME/Desktop/Templates [Trash] Path=$HOME/Desktop/Trash [Terminal] Terminal=$KDEDIR/bin/kvt [Icons] Batch=terminal.xpm Default=unknown.xpm Folder=folder.xpm Executable=exec.xpm [KFM HTML Defaults] TextColor=#000000 LinkColor=#FF0000 BgColor=#FFFFFF BgImage=WATER04.JPG
The first entry tells KFM where to find you templates. Those directories
are created by the installation of KFM. The same could be said about the Trash
entry. If KFM is forced to use a terminal to run a program, it must know which
one. This entry suggests the fine KDE terminal. The Icons section tells KFM
about some default icons. The icons are installed by the installation of KFM.
Please dont change these lines yet, since KFM 0.6.6 has them hardcoded in some
places. All icons must be in the directory $KDEDIR/lib/pics
and
all wallpapers are in $KDEDIR/lib/wallpapers
The HTML entries configure the way KFM displays the directories. You can
choose a text color ( not used yet ), the color of the links ( in this case
red ) and the color of the background. The values you may pass are the same
like the ones in the <body>
HTML tag. The BgImage
overrides the background color. In this case a image is displayed as
background in every window. Please notice how KConfig uses environment
variables like $KDEDIR
in the ressource file. You can of course
configure each directory different. This is described in one of the next
chapters.
All mountable devices are supported by KFM. Lets learn by example and have
a look at my configuration. I places a file named cdrom.kdelnk
in
my Desktop directory
[KDE Desktop Entry] Type=FSDevice Dev=/dev/scd0 MountPoint=/cd ReadOnly=1 FSType=iso9660,Default Icon=cd_mount.xpm UnmountIcon=cd_unmount.xpm
The first line in the file identifies the kind of file. The [KDE
Desktop Entry]
files are very common to KDE. For example KPanel uses
them, too.
The next line identifies this to be a device configuration file. A device may be a cdrom, a floppy disk drive, a hard disk or a NFS disk. You must be root to allow mounting of devices. But luckily the admin can allow users to mount file systems, too.
The third line tells KDE what device we are talking about. See your linux
distribution manuals for details. Sometimes you use for example
/dev/cdrom
which is a link to a real device. In version 0.5 of
KFM you must not mention such a link here.
The fourth line tells KFM where this device should be mounted to. This
means that in our example the file system of the CDROM will appear in the
directory /cd
.
The line number five tells KFM wether the device is read only ( a CDROM for example ). If it is read-write able, you must set this value to 0.
The next line tells which filesystem this device needs. The common file system for CDROMs is ISO9660 as mentioned in the example. You may name several file system types separated by colons. Default is something special. More about this later on.
The last two lines tell KFM which icon to use. The first icon is used if the device is mounted and the second one if the device is not mounted.
Since you may be a non root user, you wont be allowed to mount the CDROM
the way mentioned above. But perhaps your admin put a line for you in the
/etc/fstab
. My one looks like that
As you can see, the user is allowed to mount the floppy and the CDROM. KFM has all information in this case. You must just specify the first three lines and the line
FSType=Default
followed by the two lines for the icons. All other information is extracted
from /etc/fstab
.
Since I am root, I allowed myself to use default and explicit mounting. To give another example: Here is my file for mounting the floppy
[KDE Desktop Entry] Type=FSDevice Dev=/dev/fd0 MountPoint=/floppy ReadOnly=0 FSType=msdos,minix,default Icon=floppy_mount.xpm UnmountIcon=floppy_unmout.xpm
In each directory ( on which you have write access ) you may write a .directory file. Please mention that some directories could be a bad place for such a file. I can not mention one yet, but be warned. KPanel uses this files to give its trees in the start menu an icon. KFM notices that and uses the same icon. Of course you can use these files outside of KPanels directory strcuture, too.
KFM lets you configure the look of your directory in many ways. As
mentioned above you can make a default setting. The same entries you may write
in the [KFM HTML Defaults]
group in .kderc
may be
written in the group [KDE Desktop Entry]
. A sample
.directory
file may look like this
[KDE Desktop Entry] Icon=garfield-red.xpm TextColor=#00FF00 BgColor=#000000 LinkColor=#00FF00 BgImage=file:/tmp/icons/WATER05.JPG
Mention that the background color has no effect since an image is specified.
This is a sample file. Have a close look at it
<html><head><title>TMP</title></head><body background="/home/src/kfm-0.5/back.jpg" link=#FF0000 text=#FFFFFF> <h1>Hallo in Temp</h1> Klappts?<br> Ein <a href="http://localhost/html/install.html">Link</a><br> <files name=*.jpeg><br> <h1>Tar Archives</h1> <files name=*.tgz><br> <files name=*.tar><br> <files name=*.tar.gz><br> <h1>Hidden files</h1> <files filter=Hidden><br> <h1>Dires</h1> <files filter=Dirs><br> <h1>Executables</h1> <files filter=Executable><br> <h1>Rest of the Best</h1> <files filter=Rest><br> </body> </html>
It looks like a normal HTML file, but includes some goodies. Look at the <files> tag. With <files name=pattern> you can display all files matching this wildcard pattern. Using <files filter=Hidden> you can display all hidden files ( those starting with a point). Of interest is <files filter=Rest>. This tag displays all files in the current directory, which dont match one of the above criterias. As you may have seen already you can embed links to HTTP and FTP URLs in such a document. This way you can write a better README files. When the user looks at your sources, he will see a HTML file with some explanations for every source file and some URLs of interest. Try it out!
Torben Weis, weis@kde.org