From 38ebf64b07f99de9464905ee5f8aaee1148b6a4f Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Thu, 7 Jul 2022 15:55:54 -0500 Subject: tons of changes from when website was down --- keyboard/screenshot | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'keyboard/screenshot') 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!" -- cgit v1.2.3