#!/bin/bash # # FloShot v0.1 # # Copyright (C) 2010, Seth Rees. # Licensed under: # Eiffel Forum License, version 2 # # 1. Permission is hereby granted to use, copy, modify and/or # distribute this package, provided that: # * copyright notices are retained unchanged, # * any distribution of this package, whether modified or not, # includes this license text. # 2. Permission is hereby also granted to distribute binary programs # which depend on this package. If the binary program depends on a # modified version of this package, you are encouraged to publicly # release the modified version of this package. # # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT WARRANTY. ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR ANY # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS PACKAGE. # # END legalese. # # Prequisitries: # # 1. xclip # 2. scp # 3. ImageMagick # 4. libnotify # # Now, edit the following variables to suit your needs. # Randomly generated filename for the remote copy # of the screenshot; in this case, its seconds # since the epoch. name=`date +'%s'` # URL to prepend to the link. Do not add a trailing # slash (/). url="http://example.com" # SSH key. This is so you don't have to enter your # password every time you take a screenshot. key="/path/to/your/private.key" # SSH port. This usually isn't anything but port 22, # but you never know. port=22 # SSH username. username="example" # Domain name. domain="example.com" # Remote directory to upload files to. This directory # SHOULD exist beforehand. It is relative to your SSH's # root. directory="www/example.com/grabs" # END configuration. # *** YOU SHOULDN'T NEED TO EDIT BELOW THIS LINE *** import $HOME/Screenshot.png scp -i "$key" -P$port $HOME/Screenshot.png $username@$domain:$directory/$name.png rm $HOME/Screenshot.png echo -n "$url/$name.png" | xclip -selection clipboard notify-send -u low -i info "Screenshot uploaded."