#!/bin/sh # nicofo # 11/05/2006 if [ -z $* ] then zenity --error --title="Erreur" --text="Aucun fichier sélectionné" exit 1 fi nom=$(zenity --entry --title="Nom de l'archive" --text="Entrez le nom de l'archive (pas de .rar) :") if [ $? -eq 1 ] || [ -z "$nom" ] #on appuye sur Cancel ou on ne donne pas de nom then exit fi path="/tmp/$nom" cd ${NAUTILUS_SCRIPT_CURRENT_URI#*://} #chemin sans 'file://' (utile uniquement si fichiers pris sur le bureau) file-roller "$@" --add-to="$path" if [ -e "$path" ] then /home/nicolas/.gnome2/nautilus-scripts/"Send by mail" "$path" if [ $? -eq 2 ] #-ne : si différent de 2 (si thunderbird était déjà lancé) then zenity --notification --text="ATTENTION Ne cliquez ici qu'APRÈS avoir envoyé le mail, afin d'effacer l'archive temporaire." fi rm "$path" #$? = dernier résultat fi