Bug 8158

Summary: xdg-open run-mailcap support
Product: Portland Reporter: Per Olofsson <pelle>
Component: xdg-utilsAssignee: Portland Bugs <portland-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: high CC: ps, rdieter
Version: beta3   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: mailcap-support.patch

Description Per Olofsson 2006-09-06 14:11:36 UTC
In Debian, we have a program called run-mailcap which provides generic support
for opening files in the absence of a desktop environment. I've patched the
Debian xdg-utils package to do that. I'll attach the patch.
Comment 1 Per Olofsson 2006-09-06 14:15:40 UTC
Created attachment 6849 [details] [review]
mailcap-support.patch
Comment 2 Waldo Bastian 2006-09-06 14:39:46 UTC
Does run-mailcap open a new (X) window or does it assume a text screen?
Comment 3 Per Olofsson 2006-09-06 14:47:39 UTC
(In reply to comment #2)
> Does run-mailcap open a new (X) window or does it assume a text screen?

Depends on whether stdout is a tty or not. If it's not, a new terminal window is
opened if the application is text-based (marked needsterminal in mailcap).
Comment 4 Per Olofsson 2006-09-06 14:51:06 UTC
If it should always open a new window, we can just add >/dev/null or something
to the run-mailcap line.
Comment 5 Kevin Krammer 2006-09-06 15:13:56 UTC
This is very interesting. I have thought about using a mailcap based generic 
fallback, however it seemed to complex to do in a shell script.

Since this script (according to its manpage) can also access mime.types it 
should be pretty suitable for local file URIs

Comment 6 Rex Dieter 2008-01-07 05:02:32 UTC
Per, 
I have a question, any upstream/references for this run-mailcap tool (afaict it is debian-specific)?

Regardless, if there are no objections, I'll work to integrate your patch soon.
Comment 7 Per Olofsson 2008-01-07 05:12:39 UTC
Hi Rex,

Thanks for working on this. Yes, unfortunately it seems to be Debian-specific. It also depends on the fact that Debian has an extensive system for updating /etc/mailcap, which many packages use. However, I guess there would be no harm in calling run-mailcap from upstream xdg-open, if it exists on the system.
Comment 8 Rex Dieter 2008-01-11 14:17:25 UTC
patch committed to cvs.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.