You are not logged in.

#1 2009-03-16 08:42:04

brazzmonkey
Member
From: between keyboard and chair
Registered: 2006-03-16
Posts: 818
Website

How do I add entries to PCManFM's right-click menu? [SOLVED]

Hello there,

Is there a way to customize PCManFM right-click menu? I'd like to add custom entries, for instance:

right click a folder and choose "Start slideshow" to get the following command executed: "qiv -smt <selected_folder>"

Can this be done? How?

This could be a system-wide setting or a user setting, I don't really care.

Thanks for any guidance.

Last edited by brazzmonkey (2009-03-16 20:42:36)


what goes up must come down

Offline

#2 2009-03-16 16:19:23

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,130

Re: How do I add entries to PCManFM's right-click menu? [SOLVED]

Hmm. I would be interested in this as well. I don't use LXDE, but I do use PCManFM as my filemanager in all my WM's


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2009-03-16 16:23:42

brazzmonkey
Member
From: between keyboard and chair
Registered: 2006-03-16
Posts: 818
Website

Re: How do I add entries to PCManFM's right-click menu? [SOLVED]

I emailed PCMan. Hopefully he'll answer.


what goes up must come down

Offline

#4 2009-03-16 17:11:50

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: How do I add entries to PCManFM's right-click menu? [SOLVED]

Without editing the source code, the only way that you're going to do it is to make custom .desktop files associated with actions. If you right click --> 'Open with', you can do it there. If your actions are complex, I'd write a script that does it, right click on whatever you want to associate the action with, then select your script.

Offline

#5 2009-03-16 17:35:01

brazzmonkey
Member
From: between keyboard and chair
Registered: 2006-03-16
Posts: 818
Website

Re: How do I add entries to PCManFM's right-click menu? [SOLVED]

My actions aren't complex.
I can right-click and select "open with", type the command and it works.
I can do a .desktop file that'll launch my command.
But how am I supposed to associate this .desktop file to the folder mime type (because I guess that's what I'm actually looking for)?


what goes up must come down

Offline

#6 2009-03-16 17:39:02

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: How do I add entries to PCManFM's right-click menu? [SOLVED]

brazzmonkey wrote:

My actions aren't complex.
I can right-click and select "open with", type the command and it works.
I can do a .desktop file that'll launch my command.
But how am I supposed to associate this .desktop file to the folder mime type (because I guess that's what I'm actually looking for)?

If pcmanfm didn't automatically associate the mime type, you can add it to the .desktop file manually. But, you said folder mime type. Are you hoping to be able to right click a folder and do something? If so, I have no idea how to accomplish that other than:

--EDIT--

If one feels really adventurous, the code for the right click menu is in pcmanfm-<your_version>/src/ptk/ptk-file-menu.c'

Offline

#7 2009-03-16 20:00:48

Nezmer
Member
Registered: 2008-10-24
Posts: 559
Website

Re: How do I add entries to PCManFM's right-click menu? [SOLVED]

I think when you open with a command you provide , a desktop file is auto-created in '~/.local/share/applications' .


English is not my native language .

Offline

#8 2009-03-16 20:06:11

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,130

Re: How do I add entries to PCManFM's right-click menu? [SOLVED]

Nezmer wrote:

I think when you open with a command you provide , a desktop file is auto-created in '~/.local/share/applications' .

Yes it is. However, the problem is that it reads the ~/.local/share/applications as well as /usr/share/applications. That's why when I use, lets say Geany to open any file, the next time there are two entries for Geany.

Is there a way to avoid this?


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#9 2009-03-16 20:27:21

Nezmer
Member
Registered: 2008-10-24
Posts: 559
Website

Re: How do I add entries to PCManFM's right-click menu? [SOLVED]

Inxsible wrote:

Is there a way to avoid this?

Am I missing something here ?

If the .desktop file is already in '/usr/share/applications' , An entry should appear in the "All Applications" tab . You can choose this entry to open the file and avoid providing the command manually .


English is not my native language .

Offline

#10 2009-03-16 20:33:04

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,130

Re: How do I add entries to PCManFM's right-click menu? [SOLVED]

Nezmer wrote:
Inxsible wrote:

Is there a way to avoid this?

Am I missing something here ?

If the .desktop file is already in '/usr/share/applications' , An entry should appear in the "All Applications" tab . You can choose this entry to open the file and avoid providing the command manually .

Yup that's what I am doing, but on selecting an app from the All Applications tab, it creates a .desktop file in my home folder under the .local folder. The next time you try to go into the Open With menu, Geany (or any other app - that I selected from the All Applications list) shows up twice.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#11 2009-03-16 20:42:06

brazzmonkey
Member
From: between keyboard and chair
Registered: 2006-03-16
Posts: 818
Website

Re: How do I add entries to PCManFM's right-click menu? [SOLVED]

Nezmer wrote:

I think when you open with a command you provide , a desktop file is auto-created in '~/.local/share/applications' .

Aaaaaah! Priceless input!!! Thanks a bunch Nezmer!!
I've got to have something like this:

[MIME Cache]
inode/directory=qiv-usercreated-0.desktop

in ~/.local/share/applications, and a qiv.desktop in the very same folder.
For record, for my qiv, this gives me:

[Desktop Entry]
Encoding=UTF-8
Name=Sildeshow (random, recursive)
Exec=qiv -Rrlfstmiu
MimeType=image/jpeg
Icon=exec
NoDisplay=false

Not exactely straightforward, but finally it works.
Thanks anyone, I hope it'll be useful for you too.


what goes up must come down

Offline

#12 2009-03-16 22:38:01

Nezmer
Member
Registered: 2008-10-24
Posts: 559
Website

Re: How do I add entries to PCManFM's right-click menu? [SOLVED]

Inxsible wrote:

Yup that's what I am doing, but on selecting an app from the All Applications tab, it creates a .desktop file in my home folder under the .local folder. The next time you try to go into the Open With menu, Geany (or any other app - that I selected from the All Applications list) shows up twice.

Well , I'm not sure what's the problem here . I only see this when I attach a media player(e.g mplayer) to different file formats . PcManFM seems to insist on creating a .desktop file for each association but I don't see duplicate entries in the menu .

~/.local/share/applications$ ls | grep mplayer
mplayer-usercreated-1-usercustom-0.desktop
mplayer-usercreated-1-usercustom-1.desktop
mplayer-usercreated-1-usercustom-2.desktop
mplayer-usercreated-1-usercustom-3-usercustom-0-usercustom-0.desktop
mplayer-usercreated-1-usercustom-3-usercustom-0.desktop
mplayer-usercreated-1-usercustom-3.desktop
mplayer-usercreated-1.desktop
smplayer-usercustom-0-usercustom-0-usercustom-0-usercustom-0.desktop
smplayer-usercustom-0-usercustom-0-usercustom-0-usercustom-1.desktop
smplayer-usercustom-0-usercustom-0-usercustom-0.desktop

93106761.png

Last edited by Nezmer (2009-03-16 22:50:28)


English is not my native language .

Offline

#13 2009-03-18 23:05:09

brazzmonkey
Member
From: between keyboard and chair
Registered: 2006-03-16
Posts: 818
Website

Re: How do I add entries to PCManFM's right-click menu? [SOLVED]

IMHO, his feature is very confusing from a user point of view... and I haven't found a proper documentation for it... If you know about some useful resources, please let me know.

I needed to add another entry, and this has been a hassle: I couldn't found a way to get 2 custom entries in my menu... until I found out that (by lucky trial and error):

/home/photos/.local/share/applications/mimeinfo.cache

[MIME Cache]
inode/directory=lazyslideshow-usercreated-0.desktop;qiv-usercreated-0.desktop
application/x-shellscript=sh-usercreated-0.desktop
text/plain=leafpad-usercreated-0.desktop

.desktop files

lazyslideshow-usercreated-0.desktop
qiv-usercreated-0.desktop

Now I know LXDE will never be my desktop of choice...


what goes up must come down

Offline

#14 2010-02-18 01:51:52

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: How do I add entries to PCManFM's right-click menu? [SOLVED]

I'm a little late to the party but I hit this issue so I thought I would share my solution.  It works pretty well and is very flexible.
http://igurublog.wordpress.com/downloads/mod-pcmanfm/

Offline

Board footer

Powered by FluxBB