updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / xdg-utils-mimeo / mimeo-detection.diff
blobd2866389dffdc9b56e7f6d8b4197475e38911864
1 diff -aur xdg-utils-1.1.0-rc1/scripts/xdg-email xdg-utils-mimeo/scripts/xdg-email
2 --- xdg-utils-1.1.0-rc1/scripts/xdg-email 2011-01-01 04:03:14.000000000 -0600
3 +++ xdg-utils-mimeo/scripts/xdg-email 2012-01-23 20:21:05.258527175 -0600
4 @@ -361,6 +361,7 @@
5 elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
6 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
7 elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
8 + elif which mimeo > /dev/null; then DE=mimeo;
9 else DE=""
12 @@ -509,6 +510,18 @@
16 +open_mimeo()
18 + DEBUG 1 "Running mimeo \"$1\""
19 + mimeo "$1"
21 + if [ $? -eq 0 ]; then
22 + exit_success
23 + else
24 + exit_failure_operation_failed
25 + fi
28 open_generic()
30 IFS=":"
31 @@ -716,6 +729,10 @@
32 open_xfce "${mailto}"
35 + mimeo)
36 + open_mimeo "${mailto}"
37 + ;;
39 generic|lxde)
40 open_generic "${mailto}"
42 diff -aur xdg-utils-1.1.0-rc1/scripts/xdg-mime xdg-utils-mimeo/scripts/xdg-mime
43 --- xdg-utils-1.1.0-rc1/scripts/xdg-mime 2011-01-01 04:03:14.000000000 -0600
44 +++ xdg-utils-mimeo/scripts/xdg-mime 2012-01-23 20:21:05.258527175 -0600
45 @@ -431,6 +431,7 @@
46 elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
47 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
48 elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
49 + elif which mimeo > /dev/null; then DE=mimeo;
50 else DE=""
53 @@ -512,6 +513,16 @@
57 +info_mimeo()
59 + mimeo -m "$1"
60 + if [ $? -eq 0 ]; then
61 + exit_success
62 + else
63 + exit_failure_operation_failed
64 + fi
67 info_generic()
69 DEBUG 1 "Running file -i \"$1\""
70 @@ -848,6 +859,10 @@
71 info_gnome "$filename"
74 + mimeo)
75 + info_mimeo "$filename"
76 + ;;
79 info_generic "$filename"
81 diff -aur xdg-utils-1.1.0-rc1/scripts/xdg-open xdg-utils-mimeo/scripts/xdg-open
82 --- xdg-utils-1.1.0-rc1/scripts/xdg-open 2012-01-23 20:21:11.654904878 -0600
83 +++ xdg-utils-mimeo/scripts/xdg-open 2012-01-23 20:21:05.258527175 -0600
84 @@ -311,6 +311,7 @@
85 elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
86 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
87 elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>&1; then DE=xfce
88 + elif which mimeo > /dev/null; then DE=mimeo;
91 if [ x"$DE" = x"" ]; then
92 @@ -432,6 +433,17 @@
96 +open_mimeo()
98 + DEBUG 1 "Running mimeo \"$1\""
99 + mimeo "$1"
100 + if [ $? -eq 0 ]; then
101 + exit_success
102 + else
103 + exit_failure_operation_failed
104 + fi
107 open_generic()
109 # Paths or file:// URLs
110 @@ -570,6 +582,10 @@
111 open_lxde "$url"
114 + mimeo)
115 + open_mimeo "$url"
116 + ;;
118 generic)
119 open_generic "$url"
121 diff -aur xdg-utils-1.1.0-rc1/scripts/xdg-settings xdg-utils-mimeo/scripts/xdg-settings
122 --- xdg-utils-1.1.0-rc1/scripts/xdg-settings 2011-01-01 04:03:14.000000000 -0600
123 +++ xdg-utils-mimeo/scripts/xdg-settings 2012-01-23 20:21:05.258527175 -0600
124 @@ -316,6 +316,7 @@
125 elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
126 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
127 elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
128 + elif which mimeo > /dev/null; then DE=mimeo;
129 else DE=""
132 @@ -750,6 +751,42 @@
135 # }}} xfce
136 +# {{{ mimeo
138 +get_browser_mimeo()
140 + DEBUG 1 "Running mimeo -c 'http:'"
141 + mimeo -d http: | sed -rn '2s/ ([^ ]+) +.*/\1/p'
142 + if [ $? -eq 0 ]; then
143 + exit_success
144 + else
145 + exit_failure_operation_failed
146 + fi
149 +check_browser_mimeo()
151 + browser=`get_browser_mimeo $1`
152 + if [ x"$browser" != x"$1" ]; then
153 + echo no
154 + exit_success
155 + fi
156 + echo yes
157 + exit_success
160 +set_browser_mimeo()
162 + DEBUG 1 "Running mimeo --prefer x-scheme-handler/http \"$1\""
163 + mimeo --prefer x-scheme-handler/http \"$1\"
164 + if [ $? -eq 0 ]; then
165 + exit_success
166 + else
167 + exit_failure_operation_failed
168 + fi
171 +# }}} mimeo
172 # }}} default browser
174 dispatch_specific()
175 @@ -860,7 +897,7 @@
176 detectDE
178 case "$DE" in
179 - kde|gnome|xfce)
180 + kde|gnome|xfce|mimeo)
181 dispatch_specific "$@"