A small Nautilus (GNOME Files) extension that adds Create New File… to the context menu. It opens a native Adwaita dialog where you enter a file name and extension, and creates an empty file in the current folder.
- Entry in the folder background menu, and when a single folder is selected
- Live validation: the Create button stays disabled for empty, invalid or already existing names
- Suggested name
new-file.txtwith only the stem selected, like renaming in Nautilus - Asynchronous creation, so slow network mounts don't block Nautilus
- Works with any location GIO can write to, not just local paths
- Translatable via standard gettext (German included)
- Nautilus 46 or newer (needs
Adw.AlertDialog, libadwaita ≥ 1.5) - nautilus-python for Nautilus 4.x
- Fedora:
nautilus-python - Arch:
python-nautilus - Debian/Ubuntu:
python3-nautilus
- Fedora:
git clone https://github.com/crian/nautilus-create-file.git
cd nautilus-create-file
bash install.sh
nautilus -qUninstall with bash install.sh uninstall.
meson setup build --prefix="$HOME/.local" # or --prefix=/usr for a system-wide install
meson install -C build
nautilus -qThe extension uses plain gettext with the domain nautilus-create-file.
- Copy
po/nautilus-create-file.pottopo/<lang>.po(e.g.po/fr.po). - Set
"Language: <lang>\n"in the header and fill in themsgstrentries. - Add
<lang>topo/LINGUAS. - Run
python3 compile-translations.pyto test, or just install again.
Pull requests with new translations are welcome.
If you add or change strings in nautilus-create-file.py, update the template with:
xgettext --from-code=UTF-8 -L Python -k_ -o po/nautilus-create-file.pot nautilus-create-file.py- The newly created file is not selected afterwards (the Nautilus extension API has no hook for this).
GPL-3.0-or-later, see LICENSE.