将代码另存为一个文件中(好像不支持中文),放到~/.gnome2/nautilus-scripts/下面,然后在nautilus右键选中文件。
选择scripts,看到你另存的文件名,选中就可以了。
代码: 全选
#!/bin/bash
# Send-To
##########################################################################
# Nautilus "Send to" Script #
##########################################################################
# #
# Created by Mattia Galati (Adaron) #
# first improvement and translation by Christopher Bratusek (Chrispy) #
# #
##########################################################################
# Language Settings ---------------------------------------------------- #
destination='选择U盘'
title_destination='发送文件到'
copy='复制中....'
title_copy='等待.....'
success='文件复制成功'
title_success='OK'
errors='出现一些问题'
title_errors='错误'
no_writable='目标盘不存在或者禁止写'
title_no_writable='错误'
# End of language settings ----------------------------------------------#
##########################################################################
devices=`ls -m /media/`
vv1=${devices//, sda?/}
vv2=${vv1//cdrom?, /}
vd=${vv2//cdrom, /}
options=${vd//, / FALSE /media/}
destinazione=`zenity --list --title "$title_destination" --text "$destination" --radiolist --column " " --column "Device" FALSE /media/"$options"`
if [[ -w $destinazione ]]; then
cp $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS $destinazione | zenity --progress --pulsate --auto-close --title="$title_copy" --text="$copy"
if (( $? == 0 )); then
zenity --info --text="$success" --title "$title_success";
else zenity --info --text="$errors" --title "$title_errors";
fi
else zenity --info --text="$no_writable" --title "$title_no_writable";
fi