Fixed shot.sh after some neglect

This commit is contained in:
David Thurstenson 2019-05-18 09:21:36 -05:00
parent 12ef20f681
commit f6219cb894
1 changed files with 8 additions and 4 deletions

View File

@ -28,7 +28,7 @@ p Upload to a pastebin (defined in function)
case ${1:0:1} in case ${1:0:1} in
# Active window # Active window
w) printf "Focus target window now...\n" w) printf "Focus target window now...\n"
opts="-i $(xdotool getactivewindow)" opts="-i"
msgt="active window" msgt="active window"
;; ;;
# All # All
@ -51,7 +51,8 @@ p Upload to a pastebin (defined in function)
# Post to a pastebin # Post to a pastebin
p) destdir=$destdir/pasted p) destdir=$destdir/pasted
msgd="pastebin" msgd="pastebin"
paste=1;; paste=1
;;
*) printf "Invalid destination: %s\n" "${1:1:1}" *) printf "Invalid destination: %s\n" "${1:1:1}"
return return
@ -63,9 +64,12 @@ p Upload to a pastebin (defined in function)
local fpath="${destdir}/${fname}" local fpath="${destdir}/${fname}"
# If target is active window, give a 5 second countdown before running maim # If target is active window, give a 5 second countdown before running maim
[[ "$msgt" = "active window" ]] && countdown 5 if [[ "$msgt" = "active window" ]]; then
countdown 5
opts="-i $(xdotool getactivewindow)"
fi
maim "$opts" "$fpath" maim $opts "$fpath"
printf "Captured %s -> %s\n" "$msgt" "$msgd" printf "Captured %s -> %s\n" "$msgt" "$msgd"
# If destination is a pastebin, do the needful # If destination is a pastebin, do the needful