OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 #--------------------------------------------- | 2 #--------------------------------------------- |
3 # xdg-open | 3 # xdg-open |
4 # | 4 # |
5 # Utility script to open a URL in the registered default application. | 5 # Utility script to open a URL in the registered default application. |
6 # | 6 # |
7 # Refer to the usage() function below for usage. | 7 # Refer to the usage() function below for usage. |
8 # | 8 # |
9 # Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org> | 9 # Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org> |
10 # Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org> | 10 # Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org> |
(...skipping 24 matching lines...) Expand all Loading... |
35 read first rest | 35 read first rest |
36 echo "$first" | 36 echo "$first" |
37 } | 37 } |
38 | 38 |
39 last_word() | 39 last_word() |
40 { | 40 { |
41 read first rest | 41 read first rest |
42 echo "$rest" | 42 echo "$rest" |
43 } | 43 } |
44 | 44 |
| 45 open_darwin() |
| 46 { |
| 47 open "$1" |
| 48 |
| 49 if [ $? -eq 0 ]; then |
| 50 exit_success |
| 51 else |
| 52 exit_failure_operation_failed |
| 53 fi |
| 54 } |
| 55 |
45 open_kde() | 56 open_kde() |
46 { | 57 { |
47 if kde-open -v 2>/dev/null 1>&2; then | 58 if kde-open -v 2>/dev/null 1>&2; then |
48 kde-open "$1" | 59 kde-open "$1" |
49 else | 60 else |
50 if [ x"$KDE_SESSION_VERSION" = x"4" ]; then | 61 if [ x"$KDE_SESSION_VERSION" = x"4" ]; then |
51 kfmclient openURL "$1" | 62 kfmclient openURL "$1" |
52 else | 63 else |
53 kfmclient exec "$1" | 64 kfmclient exec "$1" |
54 kfmclient_fix_exit_code $? | 65 kfmclient_fix_exit_code $? |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 ;; | 279 ;; |
269 | 280 |
270 generic) | 281 generic) |
271 open_generic "$url" | 282 open_generic "$url" |
272 ;; | 283 ;; |
273 | 284 |
274 *) | 285 *) |
275 exit_failure_operation_impossible "no method available for opening '$url'" | 286 exit_failure_operation_impossible "no method available for opening '$url'" |
276 ;; | 287 ;; |
277 esac | 288 esac |
OLD | NEW |