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.

  • SavvyWolf@pawb.social
    link
    fedilink
    English
    arrow-up
    30
    ·
    9 hours ago

    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.

  • MentalEdge@sopuli.xyz
    link
    fedilink
    arrow-up
    21
    ·
    edit-2
    7 hours ago

    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.

      • MentalEdge@sopuli.xyz
        link
        fedilink
        arrow-up
        16
        ·
        edit-2
        8 hours ago

        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.

  • ulterno@programming.dev
    link
    fedilink
    English
    arrow-up
    9
    ·
    8 hours ago

    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