From 96102184ab96c522fe1f9175bc4d5ceb09aa1720 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Thu, 8 Jul 2021 12:04:28 +0200 Subject: grimshot: Exit 1 on cancellation Whenever the selection is cancelled by the user, exit 1, since not screenshot has been taken. --- contrib/grimshot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/grimshot b/contrib/grimshot index 921837f9..4ce31f29 100755 --- a/contrib/grimshot +++ b/contrib/grimshot @@ -113,7 +113,7 @@ elif [ "$SUBJECT" = "area" ] ; then GEOM=$(slurp -d) # Check if user exited slurp without selecting the area if [ -z "$GEOM" ]; then - exit + exit 1 fi WHAT="Area" elif [ "$SUBJECT" = "active" ] ; then @@ -132,7 +132,7 @@ elif [ "$SUBJECT" = "window" ] ; then GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp) # Check if user exited slurp without selecting the area if [ -z "$GEOM" ]; then - exit + exit 1 fi WHAT="Window" else -- cgit v1.2.3-54-g00ecf