LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How do I determine which app xdg-open will use for a file? (https://www.linuxquestions.org/questions/linux-general-1/how-do-i-determine-which-app-xdg-open-will-use-for-a-file-4175679570/)

enigma9o7 07-29-2020 02:09 AM

How do I determine which app xdg-open will use for a file?
 
Ok so got a question about xdg-open I can't figure out

When I xdg-open a text file it uses less.

If I check `xdg-mime query default text/plain` it tells me gedit.desktop, which I don't even have.

shruggy 07-29-2020 02:56 AM

xdg-open is a shell script that behaves differently depending on the used DE. In Enlightenment, it will first try invoke enlightenment_open before resorting to its open_generic function based on xdg-mime output.

enigma9o7 07-29-2020 03:32 AM

Ok that's interesting its a script, I'm trying to follow it now. Although it seems it only uses that enlgightenemnt_open for web urls....

when I use enlightenment_open on a text file, it tries to open it in vim, which I dont have, so I get a command not found. So it seems that's not in fact what xdg-open is using on text, and I should try to follow that xdg-open script a bit and figure it out still... but you got me on the right path...

enigma9o7 07-29-2020 04:20 AM

Ok update, it was not vi, it was less! That was my mistake cuz to get out I had to :q so figured vi.

and I think its using it from run-mailcap --action=view

ondoho 07-29-2020 04:27 AM

For such puzzlers I always find it helpful to get more information about the command executed - either 'man command' or 'command --help' or just 'command'. And next about the package the command belongs to.

And yes, many programs are "just" scripts and can be inspected.

Quote:

Originally Posted by enigma9o7 (Post 6150532)
That was my mistake cuz to get out I had to :q so figured vi.

To get out you had to 'q', not ':q'.


All times are GMT -5. The time now is 11:05 AM.