[Portland] [PATCH] Add support for mimeo as backend
Cedric Staniewski
cedric at gmx.ca
Wed Feb 9 05:18:54 PST 2011
mimeo[1] is a tool written in python that uses MIMEtype file
associations to determine which application should be used to open a
file. Besides, it is possible to use regular expressions to associate
files with programs.
[1] http://xyne.archlinux.ca/projects/mimeo/
---
Patch updated to actually change the correct file (.in) and moved the mimeo
part above the path / file uri check since apparently a lot of people use
mimeo for any kind of uri.
scripts/xdg-open.in | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in
index d48afb2..b2ab7f6 100644
--- a/scripts/xdg-open.in
+++ b/scripts/xdg-open.in
@@ -111,6 +111,14 @@ open_generic_xdg_mime()
open_generic()
{
+ # mimeo can handle files and any kind of uri (if configured)
+ if mimeo -h 2>/dev/null 1>&2; then
+ mimeo "$1"
+ if [ $? -eq 0 ]; then
+ exit_success
+ fi
+ fi
+
# Paths or file:// URLs
if (echo "$1" | grep -q '^file://' ||
! echo "$1" | egrep -q '^[a-zA-Z+\.\-]+:'); then
--
1.7.4
More information about the Portland
mailing list