3

I have been trying to find a solution, Which I did, I want to share because I am sure someone else would need it.

4

First of all I am using Linux Mint Debian Edition 201403, VLC version 2.1.1 Ricewind.

Now as for the solution. 1. We first need to be sure that inside VLC, we click on Tools >> Preferences menu option, this will open the preferences window dialog, and we need to make sure the Options "Allow one Instance" and "Enqueue items into playlist in one instance mode" are selected, quit VLC. enter image description here

  1. Open a terminal, and type:

su -i

this will prompt for your root password to start a session as a superuser in interactive mode.

then type:

cd /usr/share/nemo/actions/

this will take us to nemo actions path for all system users.

cp sample.nemo_action vlc.nemo_action

this will copy the sample action to a newly created vlc action for nemo.

nano vlc.nemo_action

this will edit the action file created in the previous step.

replace the contents of the file with:

[Nemo Action]

Active=true
Name=Add to VLC %F
Comment=This is a test for Nemo actions.  Action will be applied to %N
Exec=vlc %F
Icon-Name=vlc
Selection=notnone
Extensions=any
Quote=double

And that's pretty much it, in order for it to work you have to restart any instance of nemo that you might have opened.

I usually go to a terminal and type

nemo -q

This will force to quit any instance of nemo.

You might change the type and number of files this action might apply to, if you change the lines (as stated in the action sample file),

Selection=[s]ingle, [m]ultiple, any, notnone, none (background click), or a number representing how many files must be selected to display.

and/or

# 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 *****

for instance

Extensions=mp3;mp4;mkv;avi;mov;

Good Luck

EN

  • 1
    very nice. but using Selection=notnone should be used for this, or the menu entry will appear when nothing is selected – user32012 Nov 28 '14 at 10:02
  • You are absolutely right, thanks for the tip. – ximbal Nov 28 '14 at 13:49
0

Thanks for the tip! A couple possible improvements:
1. You can avoid having to use "Enqueue items into playlist in one instance mode" by changing the exec to: Exec=vlc --playlist-enqueue %F
2. You may also want to want to change %F (path+filename) in the Name field to lowercase %f (filename only) for nicer menu presentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.