Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gfixler
Last active December 12, 2015 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gfixler/4759877 to your computer and use it in GitHub Desktop.
Save gfixler/4759877 to your computer and use it in GitHub Desktop.
Gnome Nautilus script to zip/scp files to server.
#!/bin/bash
# zip/scp selected file(s) to server; copy URL to X clipboard
# put in ~/.gnome2/nautilus
# Put these 4 lines in ~/.sendit:
# SENDIT_USER='username' # your scp login
# SENDIT_SITE='yoursite.com' # site to scp to
# SENDIT_PATH='website/path' # where to 'sendit'
# SENDIT_LINK='http://www.yoursite.com/path' # for copying URL
. ~/.sendit
zipname=`zenity --entry --title "SendIt" --text "zip file name"`".zip"
cd $NAUTILUS_SCRIPT_CURRENT_URI
echo $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS | sed 's/\S*\///g' | \
xargs zip -r /tmp/$zipname
scp "/tmp/$zipname" "$SENDIT_USER@$SENDIT_SITE:$SENDIT_PATH/$zipname"
echo "$SENDIT_LINK/$zipname" | xclip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment