File format-dependent display of context menu script [Nemo scripts]

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Post Reply
caetano
Level 2
Level 2
Posts: 67
Joined: Tue May 24, 2016 5:23 am

File format-dependent display of context menu script [Nemo scripts]

Post by caetano » Thu Oct 10, 2019 2:10 pm

I have many context menu scripts and always have to navigate through sub-menus to find the right one for each task, even though nearly all of them only apply to specific file types.
If there was a way to make script menu items only appear when certain file types are selected in Nemo, it would drastically de-clutter the menus.
Is there a solution for that ?

User avatar
murray
Level 4
Level 4
Posts: 361
Joined: Tue Nov 27, 2018 4:22 pm
Location: Auckland, New Zealand

Re: File format-dependent display of context menu script [Nemo scripts]

Post by murray » Thu Oct 10, 2019 5:29 pm

In the *.nemo_action file you can specify file extensions that the action should be applied to:

Code: Select all

# What extensions to display on - this is an array, end with a semicolon
# Single entry options, ending in a semicolon:
#     "dir" for directory selection
#     "none" for no extension.
#     "nodirs" for any selection, but not including directories.
#     "any" for any file type, including directories.
# Individual specific extensions can be a semicolon-terminated list
# Extensions are NOT case sensitive.  jpg will match JPG, jPg, jpg, etc..
# **** EITHER EXTENSIONS OR MIMETYPES IS REQUIRED *****
Extensions=any;
So if you had an action that you only wanted to work on sound files then you could have:

Code: Select all

Extensions=mp3;flac;ogg;
Running Mint 19.2 Cinnamon on an Intel NUC8i5BEH with 16GB RAM and 500GB SSD

caetano
Level 2
Level 2
Posts: 67
Joined: Tue May 24, 2016 5:23 am

Re: File format-dependent display of context menu script [Nemo scripts]

Post by caetano » Fri Oct 11, 2019 3:44 am

That's great!
Is there a way to still have these action items in a submenu though?

Post Reply

Return to “Cinnamon”