this post was submitted on 02 Nov 2025
96 points (98.0% liked)

Linux

59444 readers
750 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

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.

you are viewing a single comment's thread
view the rest of the comments
[–] ulterno@programming.dev 15 points 6 days ago (1 children)

Since your question has already been answered, here's a bonus:
Add a Desktop Entry in ~/.local/share/kio/servicemenus/ to get right-click menu actions.

e.g. to add to Dolphin (and Konqueror) right-click menu

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=<MIME type of whichever type of file the application will work with>;
Actions=NameOfAction
Icon=icon-name-from-theme-for-desktop-entry

[Desktop Action NameOfAction]
Icon=icon-name-of-action-from-theme
Name=Name of action that the user will see
Exec=application-as-you-would-call-in-cli "%f"

What the %f means and what you might want to use instead

[–] utopiah@lemmy.ml 1 points 4 days ago* (last edited 4 days ago) (2 children)

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.

[–] ulterno@programming.dev 1 points 3 days ago* (last edited 3 days ago) (1 children)

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 points 2 days ago

Exactly, and it works quite well, thanks for teaching me something new :)