Created
January 7, 2017 09:50
-
-
Save sanderfoobar/1320abb777029f808110eedfdb305435 to your computer and use it in GitHub Desktop.
Paste screenshot from terminal with scrot, python-requests, libnotify, xclip
This file contains hidden or 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 | |
# Paste a screenshot taken with `scrot` to https://paste.cedsys.nl. Resulting link will be copied to clipboard. | |
# requires: python-requests, scrot, xclip, libnotify-bin, libnotify-dev | |
echo $(scrot -s -e 'printf $f | | |
python -c "\$\(echo aW1wb3J0IHN5cztpbXBvcnQgcmVxdWVzdHM7YmFzZV91cmkgPSAiaHR0cHM6Ly9wYXN0ZS5jZWRzeXMubmwiO2ZpbGVzID0geyJmaWxlc1tdIjogb3BlbihzeXMuc3RkaW4ucmVhZCgpKX07ciA9IHJlcXVlc3RzLnBvc3QoIiVzL3Bhc3RlIiAlIGJhc2VfdXJpLCBmaWxlcz1maWxlcyk7c3lzLnN0ZG91dC53cml0ZSgiJXMlcy9yYXciICUgKGJhc2VfdXJpLCByLmpzb24oKVsidXJpIl0pKQ== | |
| base64 -d\)" && mv $f ~/screenshots') | | |
xclip -selection clipboard && | |
notify-send -t 1000 $(echo "Pasted (clipboard)") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment