Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### 2026-10-05

grimblast: create parent dirs when saving to file instead of failing when they don't exist.

### 2026-08-21

grimblast: update layerrule to lua syntax
Expand Down
4 changes: 4 additions & 0 deletions grimblast/grimblast
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ grimblast::check() {
# The actual grim command used is printed to stderr
screenshot() {
local file="$1" output="$2"
if [[ -n "$file" ]]; then
mkdir -p "$(dirname "$file")"
fi
xargs --verbose grim <<<"${CURSOR:+-c} ${SCALE:+-s \"$SCALE\"} -t \"$FILETYPE\" ${output:+-o \"$output\"} ${GEOM:+-g \"$GEOM\"} ${WINDOW:+-T \"$WINDOW\"} \"$file\""
}

Expand Down Expand Up @@ -292,6 +295,7 @@ copysave() {
screenshot - "$OUTPUT" | tee >(wl-copy --type "$(get-mime-type)") || die "Clipboard error"
notify::ok "$WHAT copied to buffer and piped to stdout"
else
mkdir -p "$(dirname "$file")"
screenshot - "$OUTPUT" | tee "$file" | wl-copy --type "$(get-mime-type)" || die "Clipboard error"
title="Screenshot of $WHAT"
message="$WHAT copied to buffer and saved to $file"
Expand Down
Loading