pcmanfm - How to set the preferred order of "open with" ?

On Tue, 12 Nov 2019 17:56:26 +0100, "R.Wieser" declaimed the following:

To be fair, Applications/Preferences Main Menu Editor gives a graphical way to edit the main menu, including reordering entries (just spotted it while looking for something else: Debian xfce has a "Mime Types Editor", but does not have a Menu Editor)

Suspect you could specify it on the .config/mimeapps.list (I think the common "Text Editor" is mousepad.desktop). Commenting out the text/plain subclass for text/x-python meant LibreOffice doesn't come near it

{I also discovered that GNAT Programming Studio sticks its icon file in a non-standard location, so I had to put in the full path for the icon on its .desktop file. Now the menu shows the GNAT "G"}

Still a touch faster (especially if you have multiple types to work with) to hand edit the .config/mimeapps.list file...

Okay -- too many OSs here (and I haven't even attempted to use the graphical environment on the BeagleBone Black, which is LXQT). xfce uses Thunar.

Open With... seems to add whatever one picks. Just that, unless [X] Set selected was picked, it does not become the default for double-clicking.

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber
Loading thread data ...

On Tue, 12 Nov 2019 19:45:11 +0100, "R.Wieser" declaimed the following:

Note that .config is normally a hidden directory -- the period is critical if using a shell/console.

Try your home directory (or do it with "sudo" on the filesystem root / directory; sudo to minimize warnings about no privilege on some files)

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber

It may depend on which desktop you are using, but have a look at:-

.config/mimeapps.list

Failing that do a:-

grep -r libreoffice .config

---druck

Reply to
druck

Personally I think I bumped into something similar earlier this year while setting up a system for someone else. However I can't really remember enough to be helpful. I think the .config/mimeapps.list file was the key, as already mentioned, however with AntiX (based on Debian) I found that changing this had no effect. After spending far too long searching, I found at least one other file in another directory containing entries that were read along with those in mimeapps.list, and that was where the association that I wanted to change was being specified (with precedence over my other setting I guess).

I can't remember the location of the other file, and don't have quick access to an AntiX installation to check. It may have been called mimeapps.list just in another directory, in which case you could use "find" to locate all files with that name.

For my own use, pcmanfm (or whatever it's called) would have been removed on this basis of being hard to configure if not for others reasons besides. I would have installed one of the commander-style file managers that I use myself, and which have their own independent systems for setting file associations which don't end up spread over multiple hidden, undocumented, files, but are clearly documented and usually edited within a simple configuration interface.

Unfortunately my personal favourites are no longer being developed, so you won't find a Raspbian package for them. Except for Filerunner which I've played around with a bit, it's written in TCL/TK so you shouldn't need to compile anything to get it running even though there's probably not a package for it. It doesn't have right-click "open with" menus for files though, just single program associations and other actions triggered by configurable buttons.

The point that I'm making though is that you don't need to battle with a file manager that is difficult to use/configure the way you want it. The geat thing about Linux is that there are lots of other options for file managers, as well as window managers, taskbars/menus, and lots more. The only trouble is finding ones that suit you personally. So you've established one file manager that you don't like, go out and find one that you do!

--
__          __ 
#_ < |\| |< _#
Reply to
Computer Nerd Kev

Just one thing, as far as I can see your problems have nothing to do with the Raspberry Pi but rather with the brain dead configuration arrangements in modern unix desktop environments.

--
Steve O'Hara-Smith                          |   Directable Mirror Arrays 
C:\>WIN                                     | A better way to focus the sun 
 Click to see the full signature
Reply to
Ahem A Rivet's Shot

Dennis,

Sigh ... I somehow assumed that my filesearches (using pcmanfm and grep) would also reach those folders - and it somehow completely escaped my mind that that could well not be the case (might be related to me having configured Windows to show all files and folders, regardless of how hidden MS thinks they should be).

And yes, you can slap me for not realizing that earlier (even though you mentioned hiden files/folders a few times!). :-(

Just now I did an "ls -lat" on my home directory and found a few such hidden folders, among them .config . A quick peek into it turned up another "mimeapps.list" which contained the "Added Associations" and "Default Applications" groups you spoke of earlier.

Remember that I yesterday mentioned that I opened a scratch2 project file with "Text editor", and it became part of that "open with" list ? In the first group I noticed an entry "application/x-scratch2=", mentioning a "leafpad.desktop" value among the values following it. Checking before and after deleting it showed it got removed from that list (without having to rebuild a cache I mean).

Also, the order of the values behind the keys seems to be the order in which they get displayed in the "open with" menu.

Though I noticed that that that file and its "Added Associations" does exactly that: Although "Geany" is not mentioned after the "text/x-python3" key its still visible in the "open with" list for that filetype.

In other words, I think I now have control over at least what the top choices are in an "open with" list, and in which order they are displayed. And as I now also know that the "open with" list is actually coming from two different sources (!) it should not be too hard to remove the "extra" entries (like Geany for a python sourcefile - just edit the associated .desktop file and rebuild the cache).

Phew. Looking /back/ it does not seem all that complex. Not obvious, but not really complex either. But thats the age-old problem with acquiring

20-20 goggles. :-)

So, thanks. You've spend quite a bit of time to help me out here. I appreciate it.

Regards, Rudy Wieser

Reply to
R.Wieser

CNK,

As Dennis has been trying to tell me, yes it is (partly).

For some odd reason (stubborness probably) I tend to go with whatever the OS contains by default. Hey, its probably the default for a reason, right ? :-)

:-) That would be my preference too.

The problem with that is that you need to know what you are throwing out, and what you exchange it for. With my (very) low knowledge of Linux/Rapbian (a few weeks now and a few odds-and-ends here-and-there) I do not consider myself capable of making such choices yet.

And ofcourse there is my stubborness in conceeding defeat to a piece of software. :-)

Regards, Rudy Wieser

Reply to
R.Wieser

Ahem,

You're right there ofcourse. The problem is neither the Raspberry Pi, nor the Linux kernel. Though as the desktop and the filebrowser function as a (GUI) bottleneck to the underlying system ...

Regards, Rudy Wieser

Reply to
R.Wieser

Ah, a light bulb moment for you. Before long you'll done away with a GUI desktop completely - maybe even run headless :-) and enjoy the freedom.

Goodluck Jim

Reply to
Jim Jackson

Jim,

:-) you wish.

Don't bet on that. I'm not religious either way.

And by the way, what makes you (among others) think I do not have experience with the CLI (Linux or otherwise) ?

... or is that a required presumption for Linux users ? :-p

Regards, Rudy Wieser

Reply to
R.Wieser

Sadly, experience does tend to that view of people coming to Linux from Windows. I hope yours toes are not badly crushed :-(

Reply to
Jim Jackson

On Wed, 13 Nov 2019 11:49:10 +0100, "R.Wieser" declaimed the following:

I actually don't recall if a recursive grep looks in hidden directories...

Interesting -- most of mine seem to want mousepad.desktop; wonder if I removed leafpad back when I installed gVim.

As I believe I had mentioned

I suspect Geany is being picked up from its .desktop list of MIME types.

Note: removing the Python MIME type from the geany.desktop file may not be sufficient. Recall that Python3 is a subclass of Python and Python is a subclass of text/plain, so if geany.desktop lists text/plain, it is still a candidate for Python files. That's why I commented out the subclass for Python -> text/plain -- in my case so that LibreOffice Writer was not a candidate.

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber

Jim,

I can actually understand the assumption itself. Windows 95 is almost a quarter of a decade old. Kids, and even adults might well have no idea of the existence of a CLI (under Windows or otherwise). But as fate will have it, I do, and have used it quite a bit.

Luckily the assumption missed me completely, so no damage done. Doesn't mean that whomever dropped it should not be a bit more carefull though. :-)

Regards, Rudy Wieser

Reply to
R.Wieser

Dennis,

I wanted to write that thats something I still got to look into, until I kicked myself as its something I could do /now/. Nope, I do not see option by mentioning anything about hidden files or folders.

A quick google further I found this though (there is a space between the "*" and "."):

grep -r search * .*

Which, in retrospect(!), seems obvious - didn't quite expect it to be valid for folders too though, but as the person posting it mentioned "a directory is also a file".

:-) You did, which I only realized after I had made my post. My defense is that it was not something I took much notice of, as at that time I could not find the file its relevant for.

So do I, though I suspect that it will look at the generated cache file instead of the seperate .desktop ones.

Yup, thought about that too. I'm currently dubbing if leafpad (the "Text editor") will suit my normal textfile requirements, and just remove Geany's .desktop "mime-type= " reference to it. The same as I've already done for "LibreOffice writer" (I /really/ wanted, for script or other simple (code)textfiles, to get rid of that one).

Thats the other possibility, making python sourcefiles their own class.

Hmmm.. Maybe I'll even do both.

Regards, Rudy Wieser

Reply to
R.Wieser

My workaround is to use a very simple window manager and do most things through the command line - but then I'm (very) old school unix.

--
Steve O'Hara-Smith                          |   Directable Mirror Arrays 
C:\>WIN                                     | A better way to focus the sun 
 Click to see the full signature
Reply to
Ahem A Rivet's Shot

Better, grep -r search .

Reply to
Roger Bell_West

You don't need to uninstall one file manager in order to try another, in fact if you open a terminal and type "mc" it's possible that you'll find Midnight Commander already installed by default. It does take time to survey the options though. Indeed I haven't gone to the trouble of comparing alternatives the the ones that I mostly use, which haven't been under active development for years.

Well I can understand that, it was more or less the same thing when I was battling with these file association problems.

--
__          __ 
#_ < |\| |< _#
Reply to
Computer Nerd Kev

Roger,

I would not have expected that to work - I would have expect it to search for a single-dot filename - but a quick test just now shows it does. One of those cheat-sheet arguments I suppose. :-)

Regards, Rudy Wieser

Reply to
R.Wieser

The -r makes it recursive and . is the current directory. Without the -r it would search a file called . except that file is a directory and grep doesn't search directory entries.

--
Steve O'Hara-Smith                          |   Directable Mirror Arrays 
C:\>WIN                                     | A better way to focus the sun 
 Click to see the full signature
Reply to
Ahem A Rivet's Shot

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.