aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshmibs <shmibs@gmail.com>2014-07-05 08:59:29 -0700
committershmibs <shmibs@gmail.com>2014-07-05 08:59:29 -0700
commit59e00dc75d43bd2940de603507fbb84446eff480 (patch)
treef1319eacfc54a834001ef4f952110043536b6679
parentb597fb4292cfea9620560a6dcbd019dd97a840fb (diff)
downloaddotfiles-59e00dc75d43bd2940de603507fbb84446eff480.tar.gz
added ssh-scrot alias
calls archey, takes a scrot, makes a 250px wide scaled version, sends them to my server, and inserts the links into the clipboard.
-rw-r--r--.zshrc42
1 files changed, 42 insertions, 0 deletions
diff --git a/.zshrc b/.zshrc
index 8e3fd47..a0df374 100644
--- a/.zshrc
+++ b/.zshrc
@@ -120,3 +120,45 @@ ssh-firefox() {
# this shouldn't be necessary, but just to make sure
xpra stop ssh:shmibs@shmibbles.me:1
}
+
+ssh-scrot() {
+ archey3
+
+ if [[ "$1" != "" ]]; then
+ name=$1
+ else
+ echo -n "name: "
+ read name
+ fi
+
+ date=$(date +'%Y-%m-%d')
+
+ ssh shmibbles.me "mkdir -p http/img/scrot/$date"
+
+ if [[ "${?#0}" != "" ]]; then
+ return 1
+ fi
+
+ 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:/home/shmibs/http/img/scrot/$date
+
+ echo "http://shmibbles.me/img/scrot/$date/$name.png" | tr -d '\n' | xclip -i -selection clipboard
+ echo "http://shmibbles.me/img/scrot/$date/$name.png" | tr -d '\n' | xclip -i -selection primary
+ echo "http://shmibbles.me/img/scrot/$date/${name}_small.png" | tr -d '\n' | xclip -i -selection clipboard
+ echo "http://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
+
+}