#!/bin/sh # SCP front-end script # Installation: copy to ~/.gnome2/nautilus-scripts/ and make sure it's executable. # Created by R. C. Brandão (rcbrandao@gmail.com) # Tweaked by Erkin Bahceci # Tweaked more by hewbert (josh@hewbert.com) # -- Use notification daemon # -- Don't overwhelm with zenity dialogs # -- Don't overwhelm with xterms # -- Allow spaces in file names # -- Removed the manual options # -- Allow more than one file # -- Set dialog width # Default options port=22 user=$USER dir=/home/$USER # used for the history file extraoption= # Options for scp show_term=0 # open an xterm width=300 # Width of the dialog # First, select the file filepath="`echo $NAUTILUS_SCRIPT_SELECTED_URIS |sed 's@file://@@g'|sed 's/%20/ /g'`" if [ -d "$filepath" ]; then extraoption=-r fi if [ -n "$filepath" ]; then # Second, select where the file is going to... # Try to read last destination from file last=`cat ~/.scpto` dest=`zenity --entry --title="Destination" --text="Type in the address:[path]" --entry-text="$last" --width=$width` if [ -n "$dest" ]; then echo "$dest" >~/.scpto if [ $show_term -eq 1 ]; then xterm -e "scp -P \"$port\" $extraoption \"${filepath}\" \"${user}\"@\"${dest}\";bash" fi for file in $filepath do #zenity --info --text="$file" scp -P "$port" $extraoption "${file}" "${user}"@"${dest}" && notify-send -c transfer.complete -i stock_internet -t 3000 "SCP Complete" "scp of `basename ${file}` completed." done exit fi else zenity --error --text="No file's been selected. Exiting." fi