tMerge branch 'master' of gitorious.org:z3bra/scripts - scripts - various script and utils
(HTM) git clone git://z3bra.org/scripts
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit abf21eb578b507c0235c8cfe209d7a374ed11135
(DIR) parent 4488b54bc8a0227929233b51b6bf612550e81c30
(HTM) Author: Willy Goiffon <w.goiffon@gmail.com>
Date: Wed, 26 Jun 2013 13:40:34 +0200
Merge branch 'master' of gitorious.org:z3bra/scripts
Conflicts:
instagram
Diffstat:
A instagram | 46 +++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/instagram b/instagram
t@@ -0,0 +1,46 @@
+#!/bin/bash
+
+SSHOT_DIR=~/usr/img/scrn
+
+function usage() {
+ echo 'help!'
+}
+
+[[ $# -eq 0 ]] && exit 1
+
+if [ $# -gt 1 ]; then
+ while getopts ":tms:o:h" opt; do
+ case $opt in
+ t) THUMB=1 ;;
+ m) MULTI=1 ;;
+ s) SCREEN=$OPTARG ;;
+ h) usage ; exit ;;
+ \?) echo "invalid option: -$OPTARG"; exit 1 ;;
+ esac
+ done
+fi
+
+shift $((OPTIND-1))
+
+if [[ -z "$1" ]]; then
+ OUTPUT="$USER-$(date +%Y-%m-%d).png"
+else
+ OUTPUT=$1
+fi
+
+if [[ "$MULTI" = "1" ]] || [[ -n $SCREEN ]]; then
+
+ xdpyinfo -ext XINERAMA | sed '/^ head #/!d;s///' |
+ while IFS=' :x@,' read i w h x y; do
+ if [[ $SCREEN = "$i" ]] || [[ -z $SCREEN ]]; then
+ import -window root -crop ${w}x$h+$x+$y $SSHOT_DIR/head_$i-$1
+ [[ -n $THUMB ]] && import -window root -thumbnail 25% -crop ${w}x$h+$x+$y $SSHOT_DIR/thumb-head_$i-$1
+ fi
+ done
+
+else
+
+ import -window root $SSHOT_DIR/$1
+ [[ -n $THUMB ]] && import -window root -thumbnail 25% $SSHOT_DIR/thumb-$1
+
+fi