Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.