In this article, we will be adding a new item to the Create Document option of the right-click context menu. The item we add will allow us to easily create a new file with the extension .html.
- From the desktop, press Alt+F2 to launch the Run Application window.
- Type: gnome-terminal then press Enter. This will launch a user terminal (similar to Windows command prompt).
- In the termianl, typemkdir ~/Templates then press Enter. This creates a new directory called Templates in your
homedirectory. - Type:cd Templates then press Enter. You are now in the Templates directory.
- Type:touch html_doc.htmlthen press Enter. This creates an empty HTML document called html_doc.html.
- Right-click an empty area of your desktop and select Create Document > html_doc. A new HTML file will magically appear.
- Repeat this process to add additional templates. For example, to add a PHP template you would simply type:touch ~/Templates/php_doc.phpthen press Enter. You will now have the option php_doc.
- You can also add sub-menus to the Create Document option. To do this, you would simply create a sub-folder inside the Templates directory. For example, let's say you want to consolidate your HTML and PHP templates into a Create Document sub-menu called WebDev. You would type:mkdir ~/Templates/WebDevthen press Enter.
- Next, move your existing templates to the new WebDev directory by typing:mv Templates/*doc* Templates/WebDev/then pressing Enter. Now you can right-click an area of the desktop (or Nautilus) and select Create Document > WebDev to access your HTML and PHP templates.