"Scripts" option with right click

The dedicated forum for PCMan File Manager - http://wiki.lxde.org/en/PCManFM
PCMan
Posts: 85
Joined: Mon Oct 06, 2008 9:52 am

Re: "Scripts" option with right click

Post by PCMan »

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.
Roland
Posts: 9
Joined: Sun Dec 21, 2008 8:27 pm

Re: "Scripts" option with right click

Post by Roland »

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)?
gymka
Posts: 27
Joined: Fri May 18, 2012 6:15 am
Location: Kaunas
Contact:

Re: "Scripts" option with right click

Post by gymka »

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
Locked