• Home
  • Category: KDE

File templates in KDE Dolphin

You know that you can have a  “New file” menu on Right click in Dolphin. One of these is an HTML file. It can be customized heavily as it is just a template.

The original file resides here:


The content of the file shows that this is the copied template:

[[email protected] ~]$ cat /usr/share/templates/.source/HTMLFile.html 
    <meta content="">

For details about the key value specification of the desktop file, look here.


Creating a new File type:

Create a template. I’ll use the following for XHTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"                                                                                         
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">                                                                                    
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>                                                                           

Save it as /usr/share/templates/.source/XHTMLFile.xhtml

Now create the .desktop file which controls the menu appearance at /usr/share/templates/XHTMLFile.desktop

[Desktop Entry]
Name=XHTML File

That’s it. On closing and reloading Dolphin, you will get a new menu item on Create.