Skip to content

Instantly share code, notes, and snippets.

@lub
Last active November 2, 2015 07:07
Show Gist options
  • Save lub/9705459 to your computer and use it in GitHub Desktop.
Save lub/9705459 to your computer and use it in GitHub Desktop.
#!/bin/bash
usr=ocusername
passwd=ocpassword
server=ocserver.com
file=/tmp/screenshot_`date +%s`.png
name=$(basename $file)
if [ $1 = "fullscreen" ]; then
escrotum $file
else
escrotum --select $file
fi
curl -T $file https://$usr:$passwd@$server/remote.php/webdav/Archiv/TempShare/$name
upload=$(curl --data "path=Archiv/TempShare/$name&shareType=3" https://$usr:$passwd@$server/ocs/v1.php/apps/files_sharing/api/v1/shares)
url=$(echo $upload | grep -e "<url>.*</url>" | sed -r 's/.*<url>(.*)<\/url>.*/\1/')
echo -n $url | xclip -selection clipboard
notify-send "Screenshot taken"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment