fix the command and add an app check

parent 3d1ca032
...@@ -117,7 +117,7 @@ process_screenshot() { ...@@ -117,7 +117,7 @@ process_screenshot() {
case "$app" in case "$app" in
"") "")
if [ "$output_file" = "-" ]; then if [ "$output_file" = "-" ]; then
grim -g "${geometry}" --stdout grim -g "${geometry}" -
elif [ -n "$output_file" ]; then elif [ -n "$output_file" ]; then
grim -g "${geometry}" "$output_file" grim -g "${geometry}" "$output_file"
fi fi
...@@ -148,7 +148,7 @@ save_geometry() { ...@@ -148,7 +148,7 @@ save_geometry() {
fi fi
if [ "$COMMAND" ]; then if [ "$COMMAND" ]; then
wayshot -s "${geometry}" --stdout | $COMMAND grim -g "${geometry}" - | $COMMAND
return return
fi fi
...@@ -231,8 +231,13 @@ while true; do ...@@ -231,8 +231,13 @@ while true; do
*) *)
print_error "Неверная опция: $1" print_error "Неверная опция: $1"
;; ;;
esac esac
done done
if [ -n "$OUTPUT_APP" ]; then
if ! command -v "$OUTPUT_APP" > /dev/null 2>&1; then
print_error "Программа $OUTPUT_APP не установлена."
fi
fi
begin_grab $MODE begin_grab $MODE
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment