LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-11-2017, 04:01 AM   #1
Michael Uplawski
Member
 
Registered: Dec 2015
Location: Outside, most of the time.
Posts: 861
Blog Entries: 25

Rep: Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526
[PCManFM] and .local/share/applications: associate all MimeTypes


Good morning.

I am currently unable to define a user-command to apply to *all* selected files in a directory, if they are not all of the same MimeType.

The commands, that are defined for PCManFM are just new file-associations, which you find afterwards in “.local/share/applications”, like this one for 1 or many xz-compressed tar-archives:
Code:
[Desktop Entry]
Type=Application
Name=Goto Linked Dir
Exec=~/bin/goto_linked_dir %F
Categories=Other;
NoDisplay=true
MimeType=application/x-xz-compressed-tar
Terminal=false
Is there a way to specify *all* for the MimeType, as it will make sense in many situations?

TIA,

Michael

Last edited by Michael Uplawski; 11-11-2017 at 04:50 AM. Reason: defined too many definitions. Definitely.
 
Old 11-12-2017, 03:53 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,390
Blog Entries: 9

Rep: Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652
you can right-click on the parent folder and choose "open with..." your script.
just make sure not to make it the default!
you can also specify custom actions in ~/.local/share/file-manager/actions/*.desktop.
example:
Code:
[Desktop Entry]
Name = Open as Root
Tooltip = Open the folder as root
Icon = terminal
Profiles = on_folder;

[X-Action-Profile on_folder]
Name = Open as Root
MimeTypes = inode/directory;
SelectionCount = 1
Schemes = file;
Exec = sudo pcmanfm %f
 
1 members found this post helpful.
Old 11-15-2017, 04:25 AM   #3
Michael Uplawski
Member
 
Registered: Dec 2015
Location: Outside, most of the time.
Posts: 861

Original Poster
Blog Entries: 25

Rep: Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526
Quote:
Originally Posted by ondoho View Post
you can also specify custom actions in ~/.local/share/file-manager/actions/*.desktop.
Thank You.
I am currently too far away from my PC to try that out but, if I understand you, it suffices to omit the MimeType altogether. Too simple.

Last edited by Michael Uplawski; 11-16-2017 at 03:03 AM. Reason: +o
 
Old 11-15-2017, 02:39 PM   #4
Michael Uplawski
Member
 
Registered: Dec 2015
Location: Outside, most of the time.
Posts: 861

Original Poster
Blog Entries: 25

Rep: Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526Reputation: 526
This does not work.

The desktop files, which I modified by commenting out the MimeType, are no longer available from PCManFM. Commands, that I define as applicable to several files of different type (like: ogv, pdf and txt), will not be persisted, even if I define a name for that command.

It seems, that for the input to those user-defined commands, only one file-type (MimeType) is possible, and the line “MimeType” mandatory in the resulting .desktop file...

... until you teach me otherwise.
 
  


Reply

Tags
file-association, mimetype, pcmanfm, user-defined command


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to share with pcmanfm file manager fkervin Linux - Software 4 01-02-2015 02:42 PM
Automatically update "Applications" menu entries from /opt/local/share/applications nomadoro Linux - General 2 08-25-2012 08:26 AM
Possible ~/.local/share/applications privilege escalation in Gnome addux Linux - Security 1 03-24-2012 02:01 AM
PCmanFM 0.3.5.10 - how do I associate file types with applications? Shagbag Linux - Desktop 2 01-24-2009 08:57 AM
how do i associate files to applications?? unixmad Linux - Newbie 3 08-18-2004 04:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration