Nautilus DVD Burning Script:
<p><a href="/code/burn-dvd-video/burn-dvd-video-1.0.sh">Download</a> this script.</p>
#!/bin/sh
# Copyright (c) 2005 Graham Forest <http://www.obsoleet.org>
#
###
## The License:
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
###
## The Purpose:
#
# Ok, so basically this just uses growisofs to burn DVD Video directories (those
# things that contain VIDEO_TS folders to DVD. It'll also pass DVD Video images
# to nautilus-cd-burner.
#
###
## The Dependencies:
#
# * zenity
# * nautilus-cd-burner
# * growisofs
#
###
## The Installation:
#
# Just copy or symlink this file into ~/gnome2/nautilus-scripts/ , and set it as
# executable. You'll also probably want to change DVD_DEVICE below.
#
###
## The Usage:
#
# Right click a DVD Video folder (contains VIDEO_TS) or DVD Video image (usually
# .iso or .img), and select this script in nautilus' script submenu. For DVD
# Video directories, a confirmation dialog will pop up, followed by a progress
# dialog. For DVD Video images, you'll get bumped straight to nautilus-cd-burner
#
DVD_DEVICE=/dev/hdc
notify() {
zenity --info --info-text "$1"
}
error() {
zenity --error --error-text "$1, aborting"
exit 1
}
burn_image() {
nautilus-cd-burner "$1"
}
burn_dir() {
zenity --question --text "Burn DVD Video directory \"$1\"?" &&
growisofs -dvd-compat -dvd-video -Z $DVD_DEVICE . 2>&1 | \
awk '{ print $1; fflush() }' | zenity --progress --auto-close --text "Burning DVD"
}
# Find input
if [ -n "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]
then
TARGET="`echo $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS | head -n 1`"
elif [ -n "$1" ]
then
TARGET="$1"
# nautilus bug, maybe I'll hunt it down and fix it later
[ -e "$HOME/Desktop/$TARGET" ] && TARGET="$HOME/Desktop/$TARGET"
else
TARGET="`zenity --file-selection --directory --title='Please select a DVD folder or image to burn'`" || exit
fi
# Verify input
[ -e "$TARGET" ] || error "\"$TARGET\" doesn't exist"
if [ -d "$TARGET" ]
then
cd "$TARGET"
TARGET=`pwd`
if [ -r "$TARGET/VIDEO_TS/VIDEO_TS.IFO" ]
then
mkdir -p "$TARGET/AUDIO_TS"
burn_dir "$TARGET"
else
error "\"$TARGET\" isn't a DVD Video directory"
fi
elif [ -f "$TARGET" ]
then
cd `dirname "$TARGET"`
TARGET="`pwd`/`basename "$TARGET"`"
if [ -r "$TARGET" -a -n "`file "$TARGET" | grep 9660`" ]
then
burn_image "$TARGET"
else
error "\"$TARGET\" isn't a DVD Video image"
fi
fi