Skip to content

Instantly share code, notes, and snippets.

@fridim
Last active August 29, 2015 14:01
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 fridim/05842c5fe25c753063e3 to your computer and use it in GitHub Desktop.
Save fridim/05842c5fe25c753063e3 to your computer and use it in GitHub Desktop.
take a screenshot, upload it to openstack swift, and copy the link to the clipboard
#!/bin/sh
. ~/bin/dmenu_options
q="$(dmenu $options -l 60 -p "Screenshot :"|sed 's/ /_/g')"
[ "$q" ] || exit 1
mkdir -p ~/tmp
filename="$(date +%Y%m%d%H%M)_${q}.png"
import "${HOME}/tmp/${filename}"
. ~/PRIV/enocloud_fridim.rc
cd
swift upload public "tmp/$filename"
if [ "$?" = "0" ]; then
notify-send "image uploaded! http://d.onfi.re:8080/tmp/$filename"
echo -n "http://d.onfi.re:8080/tmp/$filename"|xsel -i
else
notify-send --urgency=critical "swift failed."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment