It has been noticed by many users that the small icons displayed in the left column of directory listings are rather ugly and not distinctive enough. They are found in the Apache-traditional /icons directory but may not be present on your computer if you do not use Apache.

You can now provide your own icons. All you have to do is to provide information about these icons through some parameters in lxr.conf.

Any graphic file may be used as an icon. However, we suggest not to exceed a 48x48 size, lest the icon would impose the line height.

  1. Icon directory

    Create a directory under DocumentRoot and put (or link) the icons inside.

  2. Update lxr.conf

    The following parameters are best located in the Global configuration section, File content subsection.

    Tell the location of your icon directory in 'iconfolder' parameter: , 'iconfolder' => 'HTML_path_to_directory'

    Remember this is a path used by HTML code. See this page for advice.

    Take care to end the directory name with a slash character (/).

    Define the name of files from the preceding directory for certain "generic" types:

    , 'diricon' => 'icon_file_for_directory' , 'parenticon' => 'icon_for_parent_directory' , 'graphicicon' => 'icon_file_for_graphic_files' , 'defaulticon' => 'default_icon_file' A file is considered graphics if its extension matches the pattern parameter 'graphicfile' defined in lxr.conf.

    Build the association rules between a file extension and an icon file in parameter 'icons':

    , 'icons' => { pattern => icon_filename , # more pattern/filename pairs }
    • pattern

      is a Perl pattern (regexp) without delimiters nor anchors (they are provided by LXR) matching a set of extensions.

      Matching has been made case-insensitive. If you do not like it, write an extended pattern (see your favorite Perl documentation) or modify LXR.
    • icon_filename

      is the icon file to be used for this set.

Example:

KDE provides nice icons with the oxygen theme. The 22x22 size is chosen. To use them, grant access to the icons directory with a symbolic link:

$ cd LXR_root_directory $ ln -s /usr/share/icons/oxygen/22x22/ small-icons

Edit the lxr.conf file. Go to the Global configuration section, File content subsection and insert the following near 'graphicfile' parameter:

, 'iconfolder' => 'small-icons/' , 'icons' => { 'c|pc' => 'mimetypes/text-x-csrc.png' , 'h|hh' => 'mimetypes/text-x-chdr.png' , 'c\+\+|cc|cpp|cxx' => 'mimetypes/text-x-c++src.png' , 'pl|pm|perl' => 'mimetypes/application-x-perl.png' , 's?html?' => 'mimetypes/text-html.png' # More can be added, this is only a small sample } , 'graphicicon' => 'mimetypes/image-x-generic.png' , 'defaulticon' => 'mimetypes/unknown.png' , 'diricon' => 'mimetypes/inode-directory.png' , 'parenticon' => 'actions/go-up.png'