#!/bin/bash
#########################################################
#							#
# This are NScripts v3.4				#
#							#
# Licensed under the GNU GENERAL PUBLIC LICENSE 3	#
#							#
# Copyright 2007 - 2008 Christopher Bratusek		#
#							#
#########################################################

echo $NAUTILUS_SCRIPT_SELECTED_URIS > ~/.gnome2/temp_menu_list

for file in $(cat ~/.gnome2/temp_menu_list); do \

	file_name=$(echo $file | sed -e 's/file:\/\///g' -e 's/\%20/\ /g')
	
	if [[ -a $HOME/.local/share/applications/ ]]; then
		cp $file_name $HOME/.local/share/applications
	else	mkdir -p $HOME/.local/share/applications
		cp $file_name $HOME/.local/share/applications
	fi
done

rm -f ~/.gnome2/temp_menu_list

