commit grim for openSUSE:Factory
Hello community, here is the log from the commit of package grim for openSUSE:Factory checked in at 2020-07-24 09:58:23 Comparing /work/SRC/openSUSE:Factory/grim (Old) and /work/SRC/openSUSE:Factory/.grim.new.3592 (New) Package is "grim" Fri Jul 24 09:58:23 2020 rev:4 rq:822177 version:1.3.1 Changes: --- /work/SRC/openSUSE:Factory/grim/grim.changes2020-01-16 18:23:38.153054811 +0100 +++ /work/SRC/openSUSE:Factory/.grim.new.3592/grim.changes 2020-07-24 09:59:53.649639568 +0200 @@ -1,0 +2,14 @@ +Wed Jul 22 07:35:49 UTC 2020 - Michael Vetter + +- Update to 1.3.1: + * Explain that '.' is grim's final fallback dir + * Correct interpretation of output rotation + * Fix maybe-uninitialized warning + * Add completions for fish-shell + * completions: add missing option + * Improve error message for when supplied region is invalid + * fix bufferoverflow in output_filepath + * contrib/completions: fix fish file path + * contrib/completions: fix unset datadir variable + +--- Old: v1.3.0.tar.gz New: v1.3.1.tar.gz Other differences: -- ++ grim.spec ++ --- /var/tmp/diff_new_pack.YJV043/_old 2020-07-24 09:59:59.309644838 +0200 +++ /var/tmp/diff_new_pack.YJV043/_new 2020-07-24 09:59:59.313644842 +0200 @@ -1,7 +1,7 @@ # # spec file for package grim # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: grim -Version:1.3.0 +Version:1.3.1 Release:0 Summary:Wayland compositor image grabber License:MIT ++ v1.3.0.tar.gz -> v1.3.1.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/grim-1.3.0/contrib/completions/fish/grim.fish new/grim-1.3.1/contrib/completions/fish/grim.fish --- old/grim-1.3.0/contrib/completions/fish/grim.fish 1970-01-01 01:00:00.0 +0100 +++ new/grim-1.3.1/contrib/completions/fish/grim.fish 2020-07-21 20:11:14.0 +0200 @@ -0,0 +1,15 @@ +function complete_outputs +if string length -q "$SWAYSOCK"; and command -sq jq +swaymsg -t get_outputs | jq -r '.[] | select(.active) | "\(.name)\t\(.make) \(.model)"' +else +return 1 +end +end + +complete -c grim -s t --exclusive --arguments 'png ppm jpeg' -d 'Output image format' +complete -c grim -s q --exclusive -d 'Output jpeg quality (default 80)' +complete -c grim -s g --exclusive -d 'Region to capture: , x' +complete -c grim -s s --exclusive -d 'Output image scale factor' +complete -c grim -s c -d 'Include cursors in the screenshot' +complete -c grim -s h -d 'Show help and exit' +complete -c grim -s o --exclusive --arguments '(complete_outputs)' -d 'Output name to capture' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/grim-1.3.0/contrib/completions/meson.build new/grim-1.3.1/contrib/completions/meson.build --- old/grim-1.3.0/contrib/completions/meson.build 1970-01-01 01:00:00.0 +0100 +++ new/grim-1.3.1/contrib/completions/meson.build 2020-07-21 20:11:14.0 +0200 @@ -0,0 +1,12 @@ +fish_comp = dependency('fish', required: false) + +if get_option('fish-completions') + fish_files = files('fish/grim.fish') + if fish_comp.found() + fish_install_dir = fish_comp.get_pkgconfig_variable('completionsdir') + else + datadir = get_option('datadir') + fish_install_dir = join_paths(datadir, 'fish', 'vendor_completions.d') + endif + install_data(fish_files, install_dir: fish_install_dir) +endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/grim-1.3.0/grim.1.scd new/grim-1.3.1/grim.1.scd --- old/grim-1.3.0/grim.1.scd 2020-01-16 12:33:31.0 +0100 +++ new/grim-1.3.1/grim.1.scd 2020-07-21 20:11:14.0 +0200 @@ -16,8 +16,9 @@ grim will write an image to _output-file_, or to a timestamped file name in *$GRIM_DEFAULT_DIR* if not specified. If *$GRIM_DEFAULT_DIR* is not set, it -defaults to *$XDG_PICTURES_DIR*. If _output-file_ is *-*, grim will output the -image to the standard output instead. +falls back first to *$XDG_PICTURES_DIR* and then to the current working +directory. If _output-file_ is *-*, grim will write the image to the standard +output instead. # OPTIONS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/grim-1.3.0/main.c new/grim-1.3.1/main.c --- old/grim-1.3.0/main.c
commit grim for openSUSE:Factory
Hello community, here is the log from the commit of package grim for openSUSE:Factory checked in at 2020-01-16 18:23:24 Comparing /work/SRC/openSUSE:Factory/grim (Old) and /work/SRC/openSUSE:Factory/.grim.new.26092 (New) Package is "grim" Thu Jan 16 18:23:24 2020 rev:3 rq:764984 version:1.3.0 Changes: --- /work/SRC/openSUSE:Factory/grim/grim.changes2019-06-04 12:14:34.175777970 +0200 +++ /work/SRC/openSUSE:Factory/.grim.new.26092/grim.changes 2020-01-16 18:23:38.153054811 +0100 @@ -1,0 +2,11 @@ +Thu Jan 16 13:39:24 UTC 2020 - Michael Vetter + +- Update to 1.3.0: + * Allow to be invoked without a destination file argument. +In which case a timestamped file will be written in +$XDG_PICTURES_DIR. + * Allow user to set default output dir. + * Provide more helpful error message + * Fix maybe-uninitialized warning + +--- Old: v1.2.0.tar.gz New: v1.3.0.tar.gz Other differences: -- ++ grim.spec ++ --- /var/tmp/diff_new_pack.4Vah3q/_old 2020-01-16 18:23:39.701055637 +0100 +++ /var/tmp/diff_new_pack.4Vah3q/_new 2020-01-16 18:23:39.701055637 +0100 @@ -1,7 +1,7 @@ # # spec file for package grim # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,12 +12,12 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: grim -Version:1.2.0 +Version:1.3.0 Release:0 Summary:Wayland compositor image grabber License:MIT ++ v1.2.0.tar.gz -> v1.3.0.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/grim-1.2.0/README.md new/grim-1.3.0/README.md --- old/grim-1.2.0/README.md2019-06-03 20:50:17.0 +0200 +++ new/grim-1.3.0/README.md2020-01-16 12:33:31.0 +0100 @@ -1,37 +1,37 @@ # grim -Grab images from a Wayland compositor. Works great with [slurp] and with [sway] >= 1.0. +Grab images from a Wayland compositor. Works great with [slurp] and with [sway]. ## Example usage Screenshoot all outputs: ```sh -grim screenshot.png +grim ``` Screenshoot a specific output: ```sh -grim -o DP-1 screenshot.png +grim -o DP-1 ``` Screenshoot a region: ```sh -grim -g "10,20 300x400" screenshot.png +grim -g "10,20 300x400" ``` Select a region and screenshoot it: ```sh -grim -g "$(slurp)" screenshot.png +grim -g "$(slurp)" ``` -Use a timestamped filename: +Use a custom filename: ```sh -grim $(xdg-user-dir PICTURES)/$(date +'%Y-%m-%d-%H%M%S_grim.png') +grim $(xdg-user-dir PICTURES)/$(date +'%s_grim.png') ``` Screenshoot and copy to clipboard: @@ -40,15 +40,18 @@ grim - | wl-copy ``` -Grab a screenshot from the focused monitor under Sway, using `swaymsg` and `jq`: +Grab a screenshot from the focused monitor under Sway, using `swaymsg` and +`jq`: ```sh -grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') screenshot.png +grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') ``` -## Package manager installation +Pick a color, using ImageMagick: -* Arch Linux: `pacman -S grim` +```sh +grim -g "$(slurp -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:- +``` ## Building from source @@ -66,11 +69,15 @@ ninja -C build ``` -To run directly, use `build/grim`, or if you would like to do a system installation (in `/usr/local` by default), run `ninja -C build install`. +To run directly, use `build/grim`, or if you would like to do a system +installation (in `/usr/local` by default), run `ninja -C build install`. ## Contributing -Either [send GitHub pull requests][github] or [send patches on the mailing list][ml]. +Either [send GitHub pull requests][github] or [send patches on the mailing +list][ml]. + +Join the IRC channel: ##emersion on Freenode. ## License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/grim-1.2.0/cairo_jpg.c new/grim-1.3.0/cairo_jpg.c --- old/grim-1.2.0/cairo_jpg.c 2019-06-03 20:50:17.0 +0200 +++ new/grim-1.3.0/cairo_jpg.c 2020-01-16 12:33:31.0 +0100 @@ -82,7 +82,7 @@ static cairo_status_t cj_write(void *closure, const unsigned char *data, unsigned int length) { - if (write((long) closure, data, lengt
commit grim for openSUSE:Factory
Hello community, here is the log from the commit of package grim for openSUSE:Factory checked in at 2019-06-04 12:14:30 Comparing /work/SRC/openSUSE:Factory/grim (Old) and /work/SRC/openSUSE:Factory/.grim.new.5148 (New) Package is "grim" Tue Jun 4 12:14:30 2019 rev:2 rq:707382 version:1.2.0 Changes: --- /work/SRC/openSUSE:Factory/grim/grim.changes2019-02-24 17:12:31.560481273 +0100 +++ /work/SRC/openSUSE:Factory/.grim.new.5148/grim.changes 2019-06-04 12:14:34.175777970 +0200 @@ -1,0 +2,7 @@ +Tue Jun 4 06:10:47 UTC 2019 - mvet...@suse.com + +- Update to 1.2.0: + * Add support for the PPM format. This is useful for speeding up +grim when piping its output into another process. + +--- Old: v1.1.tar.gz New: v1.2.0.tar.gz Other differences: -- ++ grim.spec ++ --- /var/tmp/diff_new_pack.WGAzIi/_old 2019-06-04 12:14:35.883777410 +0200 +++ /var/tmp/diff_new_pack.WGAzIi/_new 2019-06-04 12:14:35.90403 +0200 @@ -12,12 +12,12 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: grim -Version:1.1 +Version:1.2.0 Release:0 Summary:Wayland compositor image grabber License:MIT ++ v1.1.tar.gz -> v1.2.0.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/grim-1.1/README.md new/grim-1.2.0/README.md --- old/grim-1.1/README.md 2019-01-29 15:09:25.0 +0100 +++ new/grim-1.2.0/README.md2019-06-03 20:50:17.0 +0200 @@ -46,11 +46,11 @@ grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') screenshot.png ``` -## Installation +## Package manager installation * Arch Linux: `pacman -S grim` -## Building +## Building from source Install dependencies: @@ -64,9 +64,10 @@ ```sh meson build ninja -C build -build/grim ``` +To run directly, use `build/grim`, or if you would like to do a system installation (in `/usr/local` by default), run `ninja -C build install`. + ## Contributing Either [send GitHub pull requests][github] or [send patches on the mailing list][ml]. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/grim-1.1/cairo_ppm.c new/grim-1.2.0/cairo_ppm.c --- old/grim-1.1/cairo_ppm.c1970-01-01 01:00:00.0 +0100 +++ new/grim-1.2.0/cairo_ppm.c 2019-06-03 20:50:17.0 +0200 @@ -0,0 +1,96 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cairo_ppm.h" + +cairo_status_t cairo_surface_write_to_ppm_mem(cairo_surface_t *sfc, + unsigned char **data, unsigned long *len) { + // 256 bytes ought to be enough for everyone + char header[256]; + + int width = cairo_image_surface_get_width(sfc); + int height = cairo_image_surface_get_height(sfc); + + int header_len = snprintf(header, sizeof(header), "P6\n%d %d\n255\n", width, height); + assert(header_len <= (int)sizeof(header)); + + *len = header_len + width * height * 3; + unsigned char *buffer = malloc(*len); + *data = buffer; + + // We _do_not_ include the null byte + memcpy(buffer, header, header_len); + buffer += header_len; + + cairo_format_t cformat = cairo_image_surface_get_format(sfc); + assert(cformat == CAIRO_FORMAT_RGB24 || cformat == CAIRO_FORMAT_ARGB32); + + // Both formats are native-endian 32-bit ints + uint32_t *pixels = (uint32_t *)cairo_image_surface_get_data(sfc); + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + uint32_t p = *pixels++; + // RGB order + *buffer++ = (p >> 16) & 0xff; + *buffer++ = (p >> 8) & 0xff; + *buffer++ = (p >> 0) & 0xff; + } + } + + return CAIRO_STATUS_SUCCESS; +} + + +static cairo_status_t cj_write(void *closure, const unsigned char *data, + unsigned int length) { + if (write((long) closure, data, length) < length) { + return CAIRO_STATUS_WRITE_ERROR; + } else { + return CAIRO_STATUS_SUCCESS; + } +} + +cairo_status_t cairo_surface_write_to_ppm_stream(cairo_surface_t *sfc, + cairo_write_func_t write_func, void *closure) { + cairo_status_t e; + unsigned char *data = NULL; + uns