Create file option in Gnome files

Hi just wanted to ask a quick question how do you add the create file options on gnome files

Do you mean the New Document context menu? That should already be a default option as we ship Templates (in ~/Templates/).

Yes but if you install the Gnome desktop even if I put the template files in there myself it doesn’t show up

First, make sure you have xdg-user-dirs-gtk installed. Then check your ~/.config/user-dirs.dirs for this line and add it if it’s missing:

XDG_TEMPLATES_DIR="$HOME/Templates"

You may need to run xdg-user-dirs-update or logout / login for changes to take effect.

Hmm I already have that in my config by default

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/"
XDG_MUSIC_DIR="$HOME/"
XDG_PICTURES_DIR="$HOME/"
XDG_VIDEOS_DIR="$HOME/"
XDG_TEMPLATES_DIR="$HOME/templates"

Do I just make a empty file for the files I want to create in templates?

Yes. Also we have a little package that will create a few for you: nautilus-empty-file. After installing, run create-template and it will populate a few for you.

Thank you so much for that help, that gave me the option now! also got to make sure the folder is templates with a lower case t.

It’s capitalized by default. I’m not sure it matters as long as everything matches.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.