diff options
Diffstat (limited to 'keyboard/screenshot')
| -rwxr-xr-x | keyboard/screenshot | 17 | 
1 files changed, 12 insertions, 5 deletions
diff --git a/keyboard/screenshot b/keyboard/screenshot index f0d0fff..25e99cd 100755 --- a/keyboard/screenshot +++ b/keyboard/screenshot @@ -1,5 +1,13 @@  #!/bin/sh -printusage() { echo "Usage: $(basename "$0") [-cx]\n\nOPTIONS:\n  -c\tInteractively crop screenshot\n  -x\tCopy screenshot to clipboard with xclip rather than saving it" && exit; } +printusage() { +cat << HELPDOC +Usage: $(basename "$0") [-cx] + +OPTIONS: +  -c\tInteractively crop screenshot +  -x\tCopy screenshot to clipboard with xclip rather than saving it +HELPDOC +}  # Scrot and xclip opts  fmt=$(date '+%m-%d-%4Y_%I:%M:%S_%p.png') @@ -29,11 +37,10 @@ while getopts "cxh" arg; do  	case "$arg" in  		c) opt=$cropopt ;;  		x) path=$tmppath; exp=$xclipexp; summ=$xclipsumm; body=$xclipbody ;; -		h) printusage ;; -		*) printusage ;; +		h|*) printusage && exit ;;  	esac  done  scrot $opt $path --exec "$exp" \ -&& notify-send $notifyopts -i $path "$summ" "$body" \ -|| notify-send $notifyopts "Screenshot Failed!" +	&& notify-send $notifyopts -i $path "$summ" "$body" \ +	|| notify-send $notifyopts "Screenshot Failed!"  | 
