Skip to content

Instantly share code, notes, and snippets.

@x2q
Created March 30, 2013 14:35
Show Gist options
  • Select an option

  • Save x2q/5276931 to your computer and use it in GitHub Desktop.

Select an option

Save x2q/5276931 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Script by Black God (http://www.karuppuswamy.com)
# This script uploads pictures to Picasa from current directory,
# or in the selected directory
base="`echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3- | sed 's/%20/ /g'`"
if [ -z "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
dir="$base"
else
while [ ! -z "$1" -a ! -d "$base/$1" ]; do shift; done
dir="$base/$1"
fi
album=`echo $dir | awk -F/ '{print $NF }'`
notify-send -i "gtk-go-up" "Picasa upload" "`printf "Your $album album is being uploaded from $dir ..."`"
google picasa create --title "$album" "$dir"/*
if [ "$?" -ne "0" ]; then
notify-send -i "process-stop" "Picasa upload" "`printf "Your $album album upload failed"`"
else
notify-send -i "gtk-ok" "Picasa upload" "`printf "Your $album album upload is successful"`"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment