#!/bin/sh

detectDE()
{
    if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
    elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
    elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
    fi
}


detectDE
source /etc/fmwrapper.conf

case "$DE" in 
kde) 
	$KDEFM "$1"
	;;
gnome)
       $GNOMEFM "$1"
	;;
xfce)
    $XFCEFM "$1"
    ;;

generic)
    open_generic "$1"
    ;;

*)
    exit_failure_operation_impossible "no method available for opening '$url'"
    ;;

esac



