diff --git a/README.md b/README.md index c1cd4b5..ad1be3b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # grim +> ⚠️ **Heads up!** This project has [moved to SourceHut](https://sr.ht/~emersion/grim/). + Grab images from a Wayland compositor. Works great with [slurp] and with [sway]. ## Example usage diff --git a/contrib/completions/bash/grim.bash b/contrib/completions/bash/grim.bash index 7c2b1ce..9de455d 100644 --- a/contrib/completions/bash/grim.bash +++ b/contrib/completions/bash/grim.bash @@ -1,6 +1,7 @@ _grim() { _init_completion || return + local CUR PREV CUR="${COMP_WORDS[COMP_CWORD]}" PREV="${COMP_WORDS[COMP_CWORD-1]}" @@ -8,6 +9,7 @@ _grim() { COMPREPLY=($(compgen -W "png ppm jpeg" -- "$CUR")) return elif [[ "$PREV" == "-o" ]]; then + local OUTPUTS OUTPUTS="$(swaymsg -t get_outputs 2>/dev/null | \ jq -r '.[] | select(.active) | "\(.name)\t\(.make) \(.model)"' 2>/dev/null)" diff --git a/write_jpg.c b/write_jpg.c index 4476f5f..0cb57d3 100644 --- a/write_jpg.c +++ b/write_jpg.c @@ -54,7 +54,7 @@ int write_to_jpeg_stream(pixman_image_t *image, FILE *stream, int quality) { size_t written = fwrite(data, 1, len, stream); if (written < len) { free(data); - fprintf(stderr, "Failed to write jpg; only %zu of %zu bytes written\n", + fprintf(stderr, "Failed to write jpg; only %zu of %lu bytes written\n", written, len); return -1; }