|Tutorial that describes how to add an entry to the Dolphin or Konquerormenu of file browsers such as|
The entries of themenu are called templates. They are defined either system-wide, in /usr/share/templates, or only for the current user, in ~/.kde4/share/templates. In this tutorial we are going to add a new template to ~/.kde4/share/templates.
Create a templates folder in ~/.kde4/share if such a folder does not exist already, and enter the templates folder.
In this folder, create a new file with .desktop as file extension. For example: custom-file.desktop.
Open this new file and paste the following content inside it:
[Desktop Entry] Name= Comment= Type=Link URL= Icon=
Fill these fields as follows:
This is an example of a filled .desktop file:
[Desktop Entry] Name=Custom Entry Comment=New custom entry: Type=Link URL=.source/custom-entry.txt Icon=application-vnd.oasis.opendocument.text
The Name and Comment fields can be translated to any language. To provide a translation, include a new field in your .desktop file with the form "Field[language code]=Value" for each language that you want to support. For example:
[Desktop Entry] Name=Custom Entry Name[ca]=Entrada personalitzada Name[gl]=Entrada personalizada
Create a .source folder in ~/.kde4/share/templates if such a folder does not exist already, and enter the hidden .source folder.
Create a new file with the same filename that you defined in the URL field of the metadata of your new entry, and fill the file with the default content that you want for new files created with your new entry.