gcmd-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gcmd-dev] mime types and gnome-commander


From: mi
Subject: Re: [gcmd-dev] mime types and gnome-commander
Date: Wed, 8 Mar 2017 07:05:36 +0100

Ken,

A few years ago (?) figured some things out, but don't know if it's still valid.

(1) You don't need defaults.list. I already deleted this file long ago, and no 
one complained :D

(2) Put anything in mimeapss. list. If you have more than one app in one row, 
separated by ; the last entry comes first (IIRR).

(3) Home folder config overrides system wide config. Of course, it only works 
if mimeapps.list is configured properly.

For starters, you can just copy over a system wide .desktop file into .local 
applications folder, and modify it. It does not need specific ending like 
"usercreated" as long as it's correctly linked in mimeapss.list.

HOWEVER. If you use integrated file managers of Gnome, KDE, with mime 
configurator ("open with" -> "always open this file type with" checkbox) then 
they will create "usercreated" desktop files and they will recompile 
mimeapss.list. I'm not sure if they recognize manually put files, you should do 
a test. If you modify, OTOH, their usercreated files, your changes might get 
lost. 

I'm not sure but i guess the last installed always sets itself in front, in the 
systemwide configration. If you configure, for example, videos opening mpv 
(which is a far better choice than vlc) and then install vlc after, it may 
override mpv. Package installation, however, should not change your custom 
settings in .local folder.

Back then, i never got clear about which desktop managers implement which parts 
of the freedesktop.org specification. Maybe it simply wasn't worked at that 
time. KDE, for example, even created a separate folder for KDE apps, with a 
specific naming sheme.

I always had specific demands like opening some apps with specific options, for 
example, adding multiple clips to KDEnlive with -i, which never was done 
automaticly.  Or load specific URLs (clicked in Email or Docs) with different 
browser, PDF viewer, of simply download them in the background. My solution was 
to put up a script as the target of the mime type (instead of an installed 
app). For example, script "my-special-browser.sh" evaluates the URL and 
launches different stuff. Another for my-special-player evaluates the file, and 
if it's real huge resolution (like 4K), which is beyond my desktops capability, 
then starts the player with 20% lowered playing speed because only then it does 
not flicker. (You can adjust playing speed with configurable keyboard shortcuts 
like +/- too).

Anyway, still try to keep it simple: Try to go with the system wide config as 
far as possible, and don't add custom files when they are not necessary. With 
time, stuff piles up in the .local folder, and you should clear the obsolete 
stuff occasionally. 

hth mi

 




> After reading the instructions regarding Handling MIMI types MANY times 
> and searching for other advice on the web re. this subject (of course I 
> found the same basic instructions) I finally hit on the missing piece. 
> How do I determine what MIME type am I trying to handle.  Of course file 
> --mime-type samplefile will do the trick. Now I am a usercreated.desktop 
> creating fool.
> 
> Until I came across this situation....
> 
> Video files e.g. "application/octet-stream" usually .mkv file extension 
> files were by default coming up in HandBrake when clicked in 
> gnome-commander. I therefore created/edited files in 
> ~/.local/share/applications:
> 
> vlc-usercreated.desktop
> --------------------------------
> [Desktop Entry]
> Name=vlc
> MimeType=application/octet-stream;
> Exec='/usr/bin/vlc'
> Type=Application
> Terminal=false
> NoDisplay=true
> 
> Added this line to defaults.list
> 
> application/octet-stream=vlc-usercreated.desktop;
> 
> And added this line to mimeapps.list
> 
> application/octet-stream=vlc-usercreated.desktop
> 
> But it did not work.  My test .mkv file opened in HandBrake.  I removed 
> Handbrake (#yum erase HandBrake) and now the video will open in vlc as 
> expected.  I reinstalled HandBrake and again the test .mkv opened in 
> HandBrake.
> 
> I examined the files in /usr/share/applications. There I located the 
> file ghb.desktop which associates all sorts of media files with 
> HandBrake.  It appears that a .desktop file in /usr/share/applications 
> takes precedence over my usercreated.desktop. But that is not always true...
> 
> A text/plain file by default opens in LibreOffice writer from 
> gnome-commander.  I created pluma-usercreated.desktop to associate plain 
> old text files with Pluma (Mate equivalent to Gedit). And now they are. 
> In this case MY association overwrites the default. I like this better - 
> user's choice etc.
> 
> But it gets worse...  I have a plain text file of Windows parentage. 
> file --mime-type tells me it is text/plain. gnome-commander tells me 
> there is no application to open a file of type text/x-nfo. I added 
> text/x-nfo to my pluma.usercreated.desktop and the two .list files 
> described above.  Now the file will open in Pluma when clicked in 
> gnome-commander.
> 
> Applying my usual piƱata approach to problem solving (tie the problem up 
> in a bag and beat it with a stick until a solution comes out) I can deal 
> with this by deleting the ghb.desktop file - I do not want any MIME type 
> associated with HandBrake, adding these strange text types to my 
> pluma.usercreated.desktop as I come across them etc.  I am looking for 
> some advise/best practice recommendations.
> 
> Should I continue building my own .desktop files or should I add newly 
> found MIME types to the system wide .desktop files in 
> /usr/share/applications? Should I edit the system wide desktop files for 
> example to remove text/plain from LibreOffice writer instead of 
> overwriting the association with my usercreated.desktop files?
> 
> Does gnome-commander have internal rules regarding which .desktop it 
> obeys? or is that precedence a function of the OS and/or freedesktop.org 
> standard?  (If thee is such a standard - I am unable to find such a thing.)
> 
> Thanks,
> 
> Ken Taylor
> 
> Clayton, NC USA
> 
> 
> 
> 
> _______________________________________________
> gcmd-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/gcmd-devel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]