tinstagram do not save to a specific path - scripts - various script and utils
(HTM) git clone git://z3bra.org/scripts
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit f4d2b3224aab4e789d54af866615bac38d23205a
(DIR) parent 383e73b7402c4f8b24795eca7a4fd66e937f66e9
(HTM) Author: z3bra <willy@mailoo.org>
Date: Fri, 4 Jul 2014 23:27:45 +0200
instagram do not save to a specific path
Diffstat:
M instagram | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
---
(DIR) diff --git a/instagram b/instagram
t@@ -9,7 +9,6 @@
VIEWER=meh
EXEC_UPLOAD=~/bin/imgurup
-SSHOT_DIR=$PWD
WMNAME=`xprop -root WM_NAME|cut -d\" -f2`
upload() {
t@@ -33,7 +32,6 @@ Configuration:
You can set variables here, so that they will overide the default ones:
IMAGE_DIR : Where images are stored
- SSHOT_DIR : Where to save your shots
EXEC_UPLOAD : Path to the script/program used to upload your shot
SHBLAH
}
t@@ -43,17 +41,16 @@ headshot() {
xdpyinfo -ext XINERAMA | sed 's/^ head #//p' |
while IFS=' :x@,' read i w h x y; do
if [[ $1 = "$i" ]]; then
- import -window $WINDOW -crop ${w}x${h}+${x}+${y} $SSHOT_DIR/$OUTPUT
+ import -window $WINDOW -crop ${w}x${h}+${x}+${y} $OUTPUT
fi
done
}
[[ "$1" = "--help" ]] && usage && exit 0
-while getopts ":htmuwd:gs:" opt; do
+while getopts ":htmuwgs:" opt; do
case $opt in
t) THUMB=1 ;;
- d) SSHOT_DIR=$OPTARG ;;
s) SCREEN=$OPTARG ;;
u) UPLOAD=1 ;;
w) WINDOW=`xprop|grep 'window id'|cut -d\ -f7`;;
t@@ -70,12 +67,12 @@ test -z "$WINDOW" && WINDOW='root'
if [ -n "$SCREEN" ]; then
headshot $SCREEN
else
- import -window ${WINDOW} $SSHOT_DIR/$OUTPUT
+ import -window ${WINDOW} $OUTPUT
fi
-test -n "$THUMB" && import -window ${WINDOW} -thumbnail 25% $SSHOT_DIR/thumb-${OUTPUT}
+test -n "$THUMB" && import -window ${WINDOW} -thumbnail 25% thumb-$(basename ${OUTPUT})
-$VIEWER $SSHOT_DIR/$OUTPUT
+$VIEWER $OUTPUT
test "$UPLOAD" = "1" && upload ${OUTPUT}