I want to add an option under Create New to create a file of particular type. For example I use Rnote to create notes,. They have .rnote extension.

Now I create a empty file (image, 3rd option from above) with extension as .rnote , but that file when opened in the application can't be written to, because it is not a proper .rnote file, it is empty file with that extension.
How do I quickly create a proper file for rnote or any application for example libreoffice?
I am on fedora 43, kde plasma.

18 Comments
savvywolf@pawb.social · 64 pts · 291d
Don't know if this is true for all environments, but you might be able to just create a file in ~/Templates for it to show up in that list.
MonkderVierte@lemmy.zip · 24 pts · 291d
At least it should, if the file manager follows XDG desktop standards. Btw, you can customize the path in ~/.config/user-dirs.dirs file.
trulyrandomguy@lemmy.world · 21 pts · 291d
That does it. Thank you. 😀
umbrella@lemmy.ml · 4 pts · 289d
MentalEdge@sopuli.xyz · 39 pts · 291d
To add more file creation options, you use a Templates folder.
Just create a folder named "Templates" in your home directory. Then use rnote to save an empty rnote file in that directory.
Your right click menu to create new files should now get an option to "create" rnote files (which are really just copies of the file in the Templates folder).
You can add whatever types of files you want in Templates, and they don't have to be empty.
trulyrandomguy@lemmy.world · 8 pts · 291d
Thank you :)
MentalEdge@sopuli.xyz · 28 pts · 291d
If you'd like to hide the Templates folder, you can create a file called ".hidden" in your home directory.
In it, simply write "Templates".
This way the folder becomes hidden, without changing its name to add a period.
You can add additional lines with more file and foldernames, so you can keep your home directory tidy for normal use, even if stuff relies on a file or folder there not having a period in the name.
arschflugkoerper@feddit.org · 5 pts · 290d
this is great, thanks for that hint
anytimesoon@piefed.social · 3 pts · 290d
I had no idea you could do that! Excellent tip, thank you
utopiah@lemmy.ml · 2 pts · 290d
Creating a
.prototypefile in~/Templatesdidn't work for me on KDE Plasma version 5.27.5.Because it's my own filetype I added it in "File Associations" known types in text category, to open with Kate, Gvim, etc, just in case, but didn't help.
Is something else required?
MentalEdge@sopuli.xyz · 2 pts · 290d
It's not a dotfolder. It has to be "Templates" not ".Templates".
Hence my follow-up on how to hide it.
utopiah@lemmy.ml · 2 pts · 289d
Sorry typo, it's indeed
~/Templates(even verified to be sure but even has a specific icon), was already there, I didn't create it. So unfortunately still does not work.MentalEdge@sopuli.xyz · 2 pts · 289d
Looks like in plasma 5 you need to mess with .desktop files placed in
~/.local/share/templates/utopiah@lemmy.ml · 2 pts · 289d
Neat! Thanks I
~/.local/share/templates//usr/share/templatesfor.desktopfiles~/Templatesand finally now getting :fixed icon
ulterno@programming.dev · 16 pts · 291d
Since your question has already been answered, here's a bonus:
Add a
Desktop Entryin~/.local/share/kio/servicemenus/to get right-click menu actions.e.g. to add to Dolphin (and Konqueror) right-click menu
What the %f means and what you might want to use instead
utopiah@lemmy.ml · 1 pts · 289d
Oh..., that's neat thanks!
So in my use case I made a template for prototype metadata, add a menu action could be to generate the file instead of creating from the template via
Exec=field. This would prepopulate the metadatafile with e.g. the list of selected files thanks to%F.utopiah@lemmy.ml · 1 pts · 289d
Related documentation https://develop.kde.org/docs/apps/dolphin/service-menus/
ulterno@programming.dev · 1 pts · 288d
I didn't fully understand this, but if you are saying that you want to run something that reads the selected files and creates a new file in the same directory from those contents, then yes, the service menu is a better option than a template.
While templates are meant for statically configured data, there might be some variable parameters available that I just don't know of.
With the service menu thingy, you can just run any executable or shell script.
utopiah@lemmy.ml · 2 pts · 288d
Exactly, and it works quite well, thanks for teaching me something new :)