====== Mes scripts pour Nautilus ======
* Objet : Liste de scripts pour nautilus
* Niveau requis : {{tag>débutant}}
* Commentaires : //Scripts à copier dans ~/.local/share/nautilus/script et activable avec un clic droit depuis Nautilus //
* Débutant, à savoir : [[:doc:systeme:commandes:le_debianiste_qui_papillonne|Utiliser GNU/Linux en ligne de commande, tout commence là !.]] :-)
===== Copier tous les fichiers sauf les RAW depuis un appareil photo raccordé en USB =====
#! /bin/bash
#Nautilus script that copy only non RAW files from camera to Disk
#Images are placed in /Your_destination/Year/Month/Day path
#Set extension of your RAW file here will not be copied. All other files wil be copied
RAW="NEF"
#Set root destination repositorie of your Picures
DESTINATION_REP=~/Images
for image in $NAUTILUS_SCRIPT_SELECTED_URIS
do
IMAGE_NAME=${image##*/} #${image##*/} Extract file name from URI
if [[ ${IMAGE_NAME#*.} != $RAW ]] # ${image#*.} extract extension from file name
then
DESTINATION=$DESTINATION_REP/$(date -r $IMAGE_NAME +%Y)/$(date -r $IMAGE_NAME +%m)/$(date -r $IMAGE_NAME +%d)
mkdir -p $DESTINATION
cp $IMAGE_NAME $DESTINATION
fi
done
===== Déplacer tous les fichiers sauf les RAW depuis un appareil photo raccordé en USB =====
#! /bin/bash
#Nautilus script that copy only non RAW files from camera to Disk
#Images are placed in /Your_destination/Year/Month/Day path
#Set extension of your RAW file here will not be copied. All other files wil be copied
RAW="NEF"
#Set root destination repositorie of your Picures
DESTINATION_REP=~/Images
for image in $NAUTILUS_SCRIPT_SELECTED_URIS
do
IMAGE_NAME=${image##*/} #${image##*/} Extract file name from URI
if [[ ${IMAGE_NAME#*.} != $RAW ]] # ${image#*.} extract extension from file name
then
DESTINATION=$DESTINATION_REP/$(date -r $IMAGE_NAME +%Y)/$(date -r $IMAGE_NAME +%m)/$(date -r $IMAGE_NAME +%d)
mkdir -p $DESTINATION
mv $IMAGE_NAME $DESTINATION
fi
done
===== Afficher la somme de contrôle MD5 d'un fichier =====
Dépendance : Zenity
#! /bin/bash
zenity --info --title "MD5 Hash" --text $(md5sum $1)