Skip to content

Instantly share code, notes, and snippets.

@jpallari
Last active January 9, 2016 19:36
Show Gist options
  • Save jpallari/1373ccd7dd3fcdbe21fb to your computer and use it in GitHub Desktop.
Save jpallari/1373ccd7dd3fcdbe21fb to your computer and use it in GitHub Desktop.
Share screenhots using generic web host
#!/bin/sh
remote_path="myhost:path/to/screenshots/"
seconds=$(date +%s)
filename="${seconds}.png"
tmpdir="/tmp"
tmpfile="$tmpdir/$filename"
public_base_path="https://example.org/screenshots"
public_path="$public_base_path/$filename"
import "$tmpfile"
scp "$tmpfile" "$remote_path"
rm "$tmpfile"
echo "$public_path" | xsel --clipboard --input
echo "URL copied to clipboard: $public_path"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment