diff options
author | katherine <shmibs@shmibbles.me> | 2017-02-19 03:47:19 -0700 |
---|---|---|
committer | katherine <shmibs@shmibbles.me> | 2017-02-19 03:47:19 -0700 |
commit | 4cd93b09b3a179515630114078739564a35af38d (patch) | |
tree | 9d4b873cca07f62f457acd82df0c433bd2af1535 /.config/init/funcs/ssh-scrot | |
parent | 01cc1fd9f8d3484451fb33dc06d3eb76622dd7e0 (diff) | |
download | dotfiles-4cd93b09b3a179515630114078739564a35af38d.tar.gz |
move remaining funcs from .zshrc
everything should be modular now
also, cleaned up make-gif to properly parse arguments and check things
Diffstat (limited to '.config/init/funcs/ssh-scrot')
-rwxr-xr-x | .config/init/funcs/ssh-scrot | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/.config/init/funcs/ssh-scrot b/.config/init/funcs/ssh-scrot new file mode 100755 index 0000000..1e6a90c --- /dev/null +++ b/.config/init/funcs/ssh-scrot @@ -0,0 +1,45 @@ +#!/usr/bin/env zsh +# take a screenshot, upload to /img/scrot, and update current symlink + +archey3 + +local name +if [[ "$1" != "" ]]; then + name=$1 +else + echo -n "name: " + read name +fi + +local date=$(date +'%Y-%m-%d') + +local folder="http/img/scrot" +ssh shmibbles.me "mkdir -p $folder/$date" + +if [[ "${?#0}" != "" ]]; then + return 1 +fi + +ssh shmibbles.me "cd $folder; rm current 2>/dev/null; ln -s $date current" + +for i in {3..1}; do + echo -n "$i " + sleep 1 +done + +echo 'cheese!' +sleep .1 + +scrot /tmp/$name.png +convert -scale 250x /tmp/$name.png /tmp/${name}_small.png + +scp /tmp/$name.png /tmp/${name}_small.png shmibbles.me:http/img/scrot/$date + +echo "https://shmibbles.me/img/scrot/$date/$name.png" | tr -d '\n' | xclip -i -selection clipboard +echo "https://shmibbles.me/img/scrot/$date/$name.png" | tr -d '\n' | xclip -i -selection primary +echo "https://shmibbles.me/img/scrot/$date/${name}_small.png" | tr -d '\n' | xclip -i -selection clipboard +echo "https://shmibbles.me/img/scrot/$date/${name}_small.png" | tr -d '\n' | xclip -i -selection primary + +echo 'sent!' + +rm /tmp/$name.png /tmp/${name}_small.png |