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.

  • utopiah@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    2 days ago

    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
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      23 hours ago

      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.