LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-29-2020, 02:09 AM   #1
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,388

Rep: Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560
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.

Last edited by enigma9o7; 07-29-2020 at 04:20 AM.
 
Old 07-29-2020, 02:56 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
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.
 
Old 07-29-2020, 03:32 AM   #3
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,388

Original Poster
Rep: Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560
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...
 
Old 07-29-2020, 04:20 AM   #4
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,388

Original Poster
Rep: Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560
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

Last edited by enigma9o7; 07-29-2020 at 04:27 AM.
 
Old 07-29-2020, 04:27 AM   #5
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
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 View Post
That was my mistake cuz to get out I had to :q so figured vi.
To get out you had to 'q', not ':q'.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] xdg-open $PWD opens directory in firefox, so does every qt app Totoro-kun Slackware 19 09-23-2018 05:12 AM
LXer: Meld 3.15.2 Diff and Merge App Released with GTK+ 3.20 and XDG-App Support, More LXer Syndicated Linux News 0 03-28-2016 06:12 AM
xdg-open crashes when I try to open something with it (Segmentation fault) Vexe VectorLinux 1 02-11-2013 11:38 AM
xdg-open, gnome-open or kde(4?)-open??? akamikeym Programming 0 08-03-2010 08:54 AM
configure: error: The xdg python module is required (pyxdg or python-xdg) Sargalus Linux - Software 7 03-24-2010 07:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:32 AM.

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