Created
March 10, 2015 18:34
-
-
Save sarkian/f9f156e04e2f870b9dfd to your computer and use it in GitHub Desktop.
mkshot
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 | |
fname=~/images/screenshots/screen_$(date +%F_%H-%M-%S).png | |
case $1 in | |
full) | |
# scrot $fname | |
import -window root $fname | |
;; | |
select) | |
# scrot -s $fname | |
import $fname | |
;; | |
*) | |
echo "Usage: $0 full|select [pub]" | |
exit | |
;; | |
esac | |
case $2 in | |
dropbox) | |
if [ "$(dropbox status)" != 'Up to date' ] ; then | |
notify-send "Starting dropbox..." | |
dropbox start | |
sleep 7 | |
fi | |
fbasename=`basename $fname` | |
fpubname=~/.cloud/Dropbox/Public/screenshots/$fbasename | |
ln -P $fname $fpubname | |
dropbox puburl $fpubname | xclip -i -selection clipboard -f > /dev/null | |
notify-send "Public link copied to clipboard" | |
;; | |
yadisk) | |
yandex-disk status | |
if [ $? != 0 ] ; then | |
notify-send "Starting yadisk..." | |
yandex-disk start | |
sleep 7 | |
fi | |
yandex-disk publish $fname| xclip -i -selection clipboard -f > /dev/null | |
notify-send "Public link copied to clipboard" | |
;; | |
*) | |
echo $fname | xclip -i -selection clipboard -f > /dev/null | |
notify-send "Saved as $fname" | |
exit | |
;; | |
esac | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment