How to open some files based on extension rather than mime type?

Israel israeldahl at gmail.com
Thu Jan 15 19:39:15 UTC 2015


You could of course use:

/usr/share/applications/defaults.list
This hold a bunch of the values you'd normally set using xdg-mime
It usually contains stuff like:

application/rtf=libreoffice-writer.desktop

application/tab-separated-values=libreoffice-calc.desktop

application/vnd.lotus-1-2-3=libreoffice-calc.desktop

application/vnd.ms-excel=libreoffice-calc.desktop

application/vnd.ms-word=libreoffice-writer.desktop


Which you can change to whatever you like.
This should effect using things like:
xdg-open mydoc.rtf
from the terminal, and probably from any application that looks at xdg
mime types.
The first line in my above excerpt defines that
libreoffice-writer.desktop will handle this.



On 01/15/2015 10:38 AM, John Hupp wrote:
> OK, a happy discovery.  LxSession Default Apps does not do the same
> thing as R-Click: Open With: <app> + checking "Always use ..."
>
> If I do the latter with an .odt file, then LxSession Default Apps
> still has Documents: AbiWord, but odt docs open with LibreOffice.  And
> abw docs open with AbiWord.
>
> I see now also that the properties of an odt file show File Type:
> OpenDocument Text.  The format has its own mime type which can be used
> (but is not used by default) as the basis for the kind of granular
> control I wanted.
>
> So lxsession-default-apps and pcmanfm are apparently doing something
> different in the back end with mime types.  I read somewhere that
> there are perhaps 4 different mime type configuration files which are
> respected in some hierarchy.
>
> On 1/15/2015 10:17 AM, Andre Rodovalho wrote:
>> You can set this at*lxsession-default-apps*
>> *Menu > Preferences > LxSession Default Apps
>> *
>> OR
>>
>> *Right click* on the file you want to set. Let say, a Document.odt.
>> On the menu, choose *Properties*. At the Properties windows, select
>> the software you want to open as default on the "*Open With*"
>> combobox (drop down menu)... Then hit *OK*.
>>
>> Double click the file to see if works...
>>
>>
>>
>> 2015-01-14 17:57 GMT-02:00 John Hupp <lubuntu at prpcompany.com
>> <mailto:lubuntu at prpcompany.com>>:
>>
>>     I don't understand mime types very well, but it seems like the
>>     net effect as implemented is that they don't result in very
>>     granular control.
>>
>>     To be specific, I find that if I use LibreOffice Writer to create
>>     an .odt file, a double-click on the file in pcmanfm results in
>>     AbiWord opening the file.
>>
>>     I would like LibreOffice to open odt files, AbiWord to open abw
>>     files, and leafpad to open plain text files.  But
>>     lxsession-default-apps merely sets a "Document" launcher.
>>
>>     Can set up finer control to open some files according to their
>>     extension?
>>
>>     -- 
>>     Lubuntu-users mailing list
>>     Lubuntu-users at lists.ubuntu.com
>>     <mailto:Lubuntu-users at lists.ubuntu.com>
>>     Modify settings or unsubscribe at:
>>     https://lists.ubuntu.com/mailman/listinfo/lubuntu-users
>>
>>
>>
>>
>
>
>


-- 
Regards

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/lubuntu-users/attachments/20150115/a54d4070/attachment.html>


More information about the Lubuntu-users mailing list