A collection of scripts

colorgrab & scr: add $SLURP_ARGS to allow the user to customize slurp

yemou c8d147d5 d75a55d3

Changed files
+3 -4
scritps
+1 -1
scritps/colorgrab
···
[ "$color_type" ] || color_type="hex"
# Get a screenshot of the pixel
-
grim -s 1 -g "$(slurp -b 00000000 -s 00000000 -w -1 -p)" "/tmp/${0##*/}/temp.png"
case $color_type in
hex ) color=$(convert "/tmp/${0##*/}/temp.png" -format "%[hex:p]\n" info:) ;;
···
[ "$color_type" ] || color_type="hex"
# Get a screenshot of the pixel
+
grim -s 1 -g "$(slurp "${SLURP_ARGS}" -b 00000000 -s 00000000 -w -1 -p)" "/tmp/${0##*/}/temp.png"
case $color_type in
hex ) color=$(convert "/tmp/${0##*/}/temp.png" -format "%[hex:p]\n" info:) ;;
+2 -3
scritps/scr
···
grim "$filename" > "$SCR_CACHE_DIR/pic.log" 2>&1
else
# Get the geometry of the screenshot from the user and take the screenshot
-
# TODO: add a SLURP_OPTS environment variable to allow the user to customize slurp
-
if [ "$output" ]; then set -- -o "$output"; else set -- -g "$(slurp)"; fi
grim "$@" "$filename" > "$SCR_CACHE_DIR/pic.log" 2>&1
fi
···
# Intercept Ctrl+C and exit wf-recorder instead of the script
trap '' INT
-
if [ "$output" ]; then set -- -o "$output"; else set -- -g "$(slurp)"; fi
# Word splitting is favorable here
# shellcheck disable=SC2086
wf-recorder $args $rec_extraflags "$@" -f "$filename" > "$SCR_CACHE_DIR/rec.log" 2>&1 &
···
grim "$filename" > "$SCR_CACHE_DIR/pic.log" 2>&1
else
# Get the geometry of the screenshot from the user and take the screenshot
+
if [ "$output" ]; then set -- -o "$output"; else set -- -g "$(slurp "${SLURP_ARGS}")"; fi
grim "$@" "$filename" > "$SCR_CACHE_DIR/pic.log" 2>&1
fi
···
# Intercept Ctrl+C and exit wf-recorder instead of the script
trap '' INT
+
if [ "$output" ]; then set -- -o "$output"; else set -- -g "$(slurp "${SLURP_ARGS}")"; fi
# Word splitting is favorable here
# shellcheck disable=SC2086
wf-recorder $args $rec_extraflags "$@" -f "$filename" > "$SCR_CACHE_DIR/rec.log" 2>&1 &