#! /bin/bash
# android_file_transfer
# starts android-file-rtransder, gives user a clue if no device is attached...
if [[ "$DISPLAY" && "$(which Xdialog 2>&1 | grep -v "which: no")" ]]; then
	dialog="Xdialog"
else
	dialog="dialog"
fi
ret=`mtp-detect | grep "No raw"`
if [ ! "$ret" = "" ]; then
	$dialog --title "No Device Found" --left --msgbox "\nTo run \"Android File Transfer\",\ncheck the following:\n\n- the android phone is connected via usb\n- USB connection on phone is set to File Transfer (MTP)\n- the screen on phone is unlocked\n" 0 0
	exit 0
fi
android-file-transfer &
exit 0
