#!/bin/bash
# $1 = device
# $2 = mount point

# if this is an optical disk, then bail
x=`udevil info $1 | grep "optical disc"`
if [ $x != "" ]; then
	exit 0
fi

# this was for testing passed values...
y=`echo "$2" | tr -d "'"`
#DIALOG=Xdialog
#$DIALOG --title "there" \
#        --msgbox "first passed arg is $1,\nValue of X is $x,\nValue of 2 is $y" 0 0	


## this was for tweaking behavior with already-open instance of spacefm,
## acted kinda flaky, so went to straight new-window
#wins=`xwininfo -tree -root | grep spacefm | wc -l`
#if [ $wins -gt  3 ]; then
#	spacefm -w "$y" > /dev/null 2>&1
#else
#	spacefm -w "$y" > /dev/null 2>&1
#fi

spacefm -w "$y" > /dev/null 2>&1

