I am trying to add the option on right click to "Add New Document" in Ubuntu 18.04 with GNOME desktop (VM). All of the documentation and online help tells me to create an empty .txt (or any other extention) file and place it in ~/Templates
directory. That directory for some reason does not exist by defalut on my installation. No idea why. I tried adding it and then placing the empty file there but the right click menu doesn't change. Does anyone know why I didn't have this Templates directory by default and how I can successfully add the "Add New Document" option to my right click menu?? Thanks!
I used this commmand first:
$ touch ~/Templates/Empty\ Document
result:
touch: cannot touch '/home/a7ger/Templates/Empty Document': No such file or directory
I then did the following:
$ mkdir ~/Templates
$ touch ~/Templates/Empty\ Document
This ran successfully as expected. But when I right click on dekstop or in a folder within Nautilus I still do not see the option to "Add New Document". Help!!
click link to see screenshot of right click menu after running commands.
I just found my new document missing, also the template didn't exist and the template directory wasnt set.
So, to the terminal as my user user:
mkdir -p ~/Templates && touch ~/Templates/Untitled\ Document;
xdg-user-dirs-update --set TEMPLATES ~/Templates;
nautilus -q && nautilus &
And the same as a one-liner:
mkdir -p ~/Templates && touch ~/Templates/Untitled\ Document && xdg-user-dirs-update --set TEMPLATES ~/Templates && nautilus -q && nautilus &
Note: restarting Nautilus is required so that the changes take effect for the current session, you could just reboot if you prefer.
I recently had to come back to this after a long while on ubuntu 20.04 I realised it had returned, but since I wrote this I have since found out a little tip I thought might be useful here.
When creating new files if you press F2 when clicking the new document option in the context menu, the rename prompt will open saving you from renaming the file after its been created.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With