- open_generic()
- {
- # If it's a path or a file:/// URL, we can open it with run-mailcap
- #if which run-mailcap >/dev/null && <------------------------------------FIRST
- if mimeopen -v 2>/dev/null 1>&2 &&
- (echo "$1" | grep -q '^file:///' ||
- ! echo "$1" | egrep -q '^[a-zA-Z+\.\-]+:'); then
- local file
- file="$1"
- # Decode URLs
- if echo "$file" | grep -q '^file:///'; then
- file=${file#file://}
- file=$(echo "$file" | perl -pe 's/%(..)/pack("c", hex($1))/eg')
- fi
- #run-mailcap --action=view "$file" <------------------------------------SECOND
- mimeopen -n "$file"
- if [ $? -eq 0 ]; then
- exit_success
- else
- exit_failure_operation_failed
- fi
- fi
- sensible-browser "$1"
- if [ $? -eq 0 ]; then
- exit_success
- else
- exit_failure_operation_failed
- fi
- }
SHARE
TWEET
filo2
a guest
Mar 8th, 2012
16
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data

