Create “New Document” in Nautilus

In nautilus 3.63 the “New Document” has disappeared but you can easily add this option following these steps:

  1. Edit the file ~/.config/user-dirs.dirs
  2. You should set the XDG_TEMPLATES_DIR variable to “$HOME/Templates”. This is the content of my user-dirs.dirs file:

    XDG_DESKTOP_DIR="$HOME/Desktop"
    XDG_DOWNLOAD_DIR="$HOME/Downloads"
    XDG_TEMPLATES_DIR="$HOME/Templates"
    XDG_PUBLICSHARE_DIR="$HOME/Public"
    XDG_DOCUMENTS_DIR="$HOME/Documents"
    XDG_MUSIC_DIR="$HOME/Music"
    XDG_PICTURES_DIR="$HOME/Pictures"
    XDG_VIDEOS_DIR="$HOME/Videos"
  3. Create an empty text file in ~/Templates. In a shell write:
  4. [user@mypc ~]$ touch ~/Templates/text.txt
  5. Open Nautilus and click with the right button inside a directory over a black space. You will find the option New Document->Text

You can create more templates, for example I have created one for html files. You just have to create a html file in “$HOME/Templates” with the following content:

<!DOCTYPE html>
<html>
  <head>
    <title></title>
  </head>
  <body>
  </body>
</html>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s