#!/bin/bash --norc


for doc; do
	if [[ "$doc" = file://* ]]; then
		kfmclient exec "$doc" >>"$HOME/.xsession-errors" 2>&1
	else
		if [ ! -f "$doc" ]; then
			echo "open: Document file \"$doc\" does not exist" 2>&1
		elif [ ! -r "$doc" ]; then
			echo "open: Document file \"$doc\" is not readable" 2>&1
		else
			kfmclient exec "$(furl "$doc")" >>"$HOME/.xsession-errors" 2>&1
		fi
	fi
done
