Ask Your Question

file template - create new file, with name from the user (input)

asked 2016-06-25 01:20:09 -0500

noammo gravatar image

I'm trying to make option for "new file" (txt, html, etc..) but I can only make file that get "auto name" - the name of the file in the Templates folder - for example, if I have in the Templates folder file named "new txt file.txt", so right click -> new txt file, will create file "Untitled new txt file.txt" and I want to do that the name will be entered by the user - like in New Folder option.

How can I do that? (I'm using gnome)

Thank, Noam

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-06-25 07:48:26 -0500

JetStream gravatar image

updated 2016-06-25 12:53:01 -0500

In my Templates folder, I have a blank file named 'New File' and it does the job. The new file is created with the rename step activated. Don't recollect doing anything extra.

I posted pictures to show how it works on my system but my account does not have the authorisation to post pictures yet. Pictures below may show up at a later date when my account reaches that status. Meanwhile, they may be viewed here

/home/mochapenguin/Templates /home/mochapenguin/Templates

Right click > Click on New File

New File created and in rename mode

[Added 25-Jun-2016] Not sure, just a few things worth checking:

Someone here had issues with the value of XDG_TEMPLATE_DIR variable in ~/.config/user-dirs.dirs

edit flag offensive delete link more


It's doesn't work for me.. did I miss something?

(sorry about that the menu was cut, but you can see which option I chose - because the file name)

noammo gravatar imagenoammo ( 2016-06-25 10:31:47 -0500 )edit

No worries about the part being cut. I can see you have to explicitly rename the new file.

JetStream gravatar imageJetStream ( 2016-06-25 12:33:49 -0500 )edit

But it's still not working..

noammo gravatar imagenoammo ( 2016-06-25 13:32:14 -0500 )edit

Sorry mate, I am out of ideas. You appear to have done the setup but I am clueless why it saves the file name at first before you having to explicitly rename. Maybe someone with more knowledge will come along with the answer.

JetStream gravatar imageJetStream ( 2016-06-25 15:25:02 -0500 )edit

yes,, I hope.. anyway - thanks for the help, any help is great :)

noammo gravatar imagenoammo ( 2016-06-25 17:45:21 -0500 )edit

answered 2016-06-25 02:20:50 -0500

centinel20 gravatar image

You can just right click on the new file and look for "Rename" option on the menu. You can also create a new file from the command line with touch:

$ touch "any name for file here.txt"

if you dont use spaces you can skip the quotes:

$ touch anynameyouwantreally.txt

If you want another directory:

$ touch /home/user/thename.txt

Hope this was what you meant.

edit flag offensive delete link more


no, I meant that the file will be created, instead of get a automatic name (the name of the file in the Template folder) will open a input box, so I can type the name (sure, I can rename it with 2 clicks, but still) - like with folders, when I click "New Folder", so i get a input box to type in the folder name - that's what I want with files. Hope that is more understandable.

noammo gravatar imagenoammo ( 2016-06-25 03:26:02 -0500 )edit

Oh yes I understand now. I dont Know how to do that. Sorry. I think this comment could help clarify the question maybe you should add it as a comment to the main question? Cheers.

centinel20 gravatar imagecentinel20 ( 2016-06-25 10:57:55 -0500 )edit

I don't know how to add this as a comment to the main question.. And thanks you all for the help!

noammo gravatar imagenoammo ( 2016-06-25 13:35:01 -0500 )edit

Question Tools

1 follower


Asked: 2016-06-25 01:20:09 -0500

Seen: 2,338 times

Last updated: Jun 25 '16