LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 03:01 AM   #1
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,623
Blog Entries: 40

Rep: Reputation: Disabled
[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 03:50 AM. Reason: defined too many definitions. Definitely.
 
Old 11-12-2017, 02:53 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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, 03:25 AM   #3
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,623

Original Poster
Blog Entries: 40

Rep: Reputation: Disabled
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 02:03 AM. Reason: +o
 
Old 11-15-2017, 01:39 PM   #4
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,623

Original Poster
Blog Entries: 40

Rep: Reputation: Disabled
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



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 01:42 PM
Automatically update "Applications" menu entries from /opt/local/share/applications nomadoro Linux - General 2 08-25-2012 07:26 AM
Possible ~/.local/share/applications privilege escalation in Gnome addux Linux - Security 1 03-24-2012 01:01 AM
PCmanFM 0.3.5.10 - how do I associate file types with applications? Shagbag Linux - Desktop 2 01-24-2009 07:57 AM
how do i associate files to applications?? unixmad Linux - Newbie 3 08-18-2004 03:50 PM

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

All times are GMT -5. The time now is 12:49 PM.

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
Open Source Consulting | Domain Registration