Skip to content

Instantly share code, notes, and snippets.

@sarkian
Created March 10, 2015 18:34
Show Gist options
  • Save sarkian/f9f156e04e2f870b9dfd to your computer and use it in GitHub Desktop.
Save sarkian/f9f156e04e2f870b9dfd to your computer and use it in GitHub Desktop.
mkshot
#!/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