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 <html> <head> <title></title> <meta content=""> <style></style> </head> <body></body> </html>
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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> </head> <body> </body> </html>
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 Type=Link URL=.source/XHTMLFile.xhtml Icon=text-html
That’s it. On closing and reloading Dolphin, you will get a new menu item on Create.
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.