Rename 'selection' to 'anything'

This commit is contained in:
Ragnar Groot Koerkamp 2021-07-01 20:55:05 +02:00
parent f752aa7629
commit f93ebba897

View file

@ -32,7 +32,7 @@ FILE=${3:-$(getTargetDirectory)/$(date -Ins).png}
if [ "$ACTION" != "save" ] && [ "$ACTION" != "copy" ] && [ "$ACTION" != "check" ]; then if [ "$ACTION" != "save" ] && [ "$ACTION" != "copy" ] && [ "$ACTION" != "check" ]; then
echo "Usage:" echo "Usage:"
echo " grimshot [--notify] (copy|save) [active|screen|output|area|window|selection] [FILE|-]" echo " grimshot [--notify] (copy|save) [active|screen|output|area|window|anything] [FILE|-]"
echo " grimshot check" echo " grimshot check"
echo " grimshot usage" echo " grimshot usage"
echo "" echo ""
@ -47,8 +47,8 @@ if [ "$ACTION" != "save" ] && [ "$ACTION" != "copy" ] && [ "$ACTION" != "check"
echo " screen: All visible outputs." echo " screen: All visible outputs."
echo " output: Currently active output." echo " output: Currently active output."
echo " area: Manually select a region." echo " area: Manually select a region."
echo " window: Manually select a window." echo " window: Manually select an area or window."
echo " selection: Manually select an area, window, or output." echo " anything: Manually select an area, window, or output."
exit exit
fi fi
@ -136,13 +136,13 @@ elif [ "$SUBJECT" = "window" ] ; then
exit 1 exit 1
fi fi
WHAT="Window" WHAT="Window"
elif [ "$SUBJECT" = "selection" ] ; then elif [ "$SUBJECT" = "anything" ] ; then
GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp -o) GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp -o)
# Check if user exited slurp without selecting the area # Check if user exited slurp without selecting the area
if [ -z "$GEOM" ]; then if [ -z "$GEOM" ]; then
exit exit
fi fi
WHAT="Selection" WHAT="Anything"
else else
die "Unknown subject to take a screen shot from" "$SUBJECT" die "Unknown subject to take a screen shot from" "$SUBJECT"
fi fi