"Scripts" option with right click

The dedicated forum for PCMan File Manager - http://wiki.lxde.org/en/PCManFM

Re: "Scripts" option with right click

Postby PCMan » Sat Jul 04, 2009 3:59 am

1. Run update-desktop-database ~/.local/share/applications after you did the edit.
2. Add NoDisplay=true, and it won't be shown in applications menu.
PCMan
 
Posts: 85
Joined: Mon Oct 06, 2008 10:52 am

Re: "Scripts" option with right click

Postby Roland » Tue Jan 18, 2011 9:44 am

Sorry for raising old topic, but user scripts are still not implemented, so need to use this way.

I'm trying to create a context menu "Send email", using *.desktop file.
But have a trouble, what default Mimetype i have to use for all files (mean that associate desktop with every file)?
Roland
 
Posts: 9
Joined: Sun Dec 21, 2008 9:27 pm

Re: "Scripts" option with right click

Postby gymka » Fri May 25, 2012 11:29 am

Roland wrote:Sorry for raising old topic, but user scripts are still not implemented, so need to use this way.

I'm trying to create a context menu "Send email", using *.desktop file.
But have a trouble, what default Mimetype i have to use for all files (mean that associate desktop with every file)?

in folder ~/.local/share/applications create your .desktop file, in my case i created two desktop files "test.desktop" and "test2.desktop". run
Code: Select all
cp ~/.local/share/applications/mimeapps.list ~/.local/share/applications/mimeapps.list_backup
cat /etc/mime.types |sed 's/\(.*\)\t.*/\1/g'|sed 's/\t//g'| tr "\\n"";"|sed 's/;/=test.desktop;test2.desktop\n/g'>>~/.local/share/applications/mimeapps.list'

now in all files context menu there is buttons from test.desktop and from test2.desktop. simple:)

P.S. 1. afaik /etc/mime.types is created with tool "mime-types", maybe in other distros there is no such file, but in archlinux there is:)
2. my /etc/mime.types file had comments, so before executing script i manually removed these comments.
3. personally I needed context menu button for all files and only for images, so run script like above and then executed another:
Code: Select all
sed -i 's/\(image\/.*\)/\1test3_only_for_images.desktop;/g' ~/.local/share/applicatons/mimeapps.list
and it added context menu button only to images:)
"Kvailam gimti ne sarmata. Tik mirti kvailam gėda." E. M. Remarkas
"Родиться глупым не стыдно, стыдно только умирать глупцом." Э. М. Ремарк
"To born stupid is not shame, just to die stupid is shameful." E. M. Remarque
gymka
 
Posts: 27
Joined: Fri May 18, 2012 7:15 am
Location: Kaunas

Previous

Return to PCManFM

Who is online

Users browsing this forum: No registered users and 0 guests