Add save as an option for agents

This commit is contained in:
David Heinemeier Hansson
2026-05-09 12:04:34 +02:00
parent 10c42afcf2
commit 9a2c53d571
+19 -12
View File
@@ -2,7 +2,7 @@
# omarchy:summary=Take a screenshot # omarchy:summary=Take a screenshot
# omarchy:group=capture # omarchy:group=capture
# omarchy:args=[smart|region|windows|fullscreen] [slurp|copy] [--editor=<name>] # omarchy:args=[smart|region|windows|fullscreen] [slurp|copy|save] [--editor=<name>]
# omarchy:examples=omarchy screenshot | omarchy capture screenshot region # omarchy:examples=omarchy screenshot | omarchy capture screenshot region
# omarchy:aliases=omarchy screenshot # omarchy:aliases=omarchy screenshot
@@ -126,15 +126,22 @@ esac
FILENAME="screenshot-$(date +'%Y-%m-%d_%H-%M-%S').png" FILENAME="screenshot-$(date +'%Y-%m-%d_%H-%M-%S').png"
FILEPATH="$OUTPUT_DIR/$FILENAME" FILEPATH="$OUTPUT_DIR/$FILENAME"
if [[ $PROCESSING == "slurp" ]]; then case "$PROCESSING" in
grim -g "$SELECTION" "$FILEPATH" || exit 1 slurp)
echo "$FILEPATH" grim -g "$SELECTION" "$FILEPATH" || exit 1
wl-copy <"$FILEPATH" echo "$FILEPATH"
wl-copy <"$FILEPATH"
( (
ACTION=$(notify-send "Screenshot saved to clipboard and file" "Edit with Super + Alt + , (or click this)" -t 10000 -i "$FILEPATH" -A "default=edit") ACTION=$(notify-send "Screenshot saved to clipboard and file" "Edit with Super + Alt + , (or click this)" -t 10000 -i "$FILEPATH" -A "default=edit")
[[ $ACTION == "default" ]] && open_editor "$FILEPATH" [[ $ACTION == "default" ]] && open_editor "$FILEPATH"
) & ) >/dev/null 2>&1 &
else ;;
grim -g "$SELECTION" - | wl-copy copy)
fi grim -g "$SELECTION" - | wl-copy
;;
save)
grim -g "$SELECTION" "$FILEPATH" || exit 1
echo "$FILEPATH"
;;
esac