From 2f7b3b63d5c42ed79369f069d09c32cbcddb308f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vinko=20Ka=C5=A1ljevi=C4=87?= Date: Wed, 15 Jul 2020 17:09:14 +0200 Subject: [PATCH] Add check for empty GEOM variable In case when slurp is used to select part of screen, if user aborts the selection, grimshot will capture the whole screen instead of exiting. This is fixed with check for empty variable. --- contrib/grimshot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/grimshot b/contrib/grimshot index 4ee8d902c..b11ae8bf3 100755 --- a/contrib/grimshot +++ b/contrib/grimshot @@ -111,6 +111,10 @@ if [ "$ACTION" = "check" ] ; then exit elif [ "$SUBJECT" = "area" ] ; then GEOM=$(slurp -d) + # Check if user exited slurp without selecting the area + if [ -z "$GEOM" ]; then + exit + fi WHAT="Area" elif [ "$SUBJECT" = "active" ] ; then FOCUSED=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?, .floating_nodes[]?) | select(.focused)')