Created
August 19, 2018 11:49
-
-
Save jirwin/71bd319be1ca5e8c51176fb2dbc29264 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Create a temporary file to store the screenshot in | |
tmpfile=$(mktemp /tmp/XXXXXXX.png) | |
# Take the screenshot | |
scrot -s "$tmpfile" > /dev/null | |
# Copy the file to the server | |
scp "$tmpfile" gina:/mnt/khaldrobo/screenshots > /dev/null | |
# Generate the url for the screenshot | |
url=https://s.jirwin.xyz/$(basename "$tmpfile") | |
# Output url, open the url in the browser, and copy url to clipboard | |
echo "$url" | xclip | |
xdg-open "$url" &> /dev/null | |
echo "$url" | |
# Remove the screenshot | |
rm "$tmpfile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment