From c34a9f5ca6611bfc64ded66ed464981285c78eeb Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 23 Jan 2018 01:05:22 +0100 Subject: [PATCH] screenshot: save screenshot files in XDG_PICTURES_DIR If XDG_PICTURES_DIR not given, it will use the current directory, as it was before. Signed-off-by: Aleksander Morgado Reviewed-by: Daniel Stone --- clients/screenshot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clients/screenshot.c b/clients/screenshot.c index be8d9fe6..78a5d424 100644 --- a/clients/screenshot.c +++ b/clients/screenshot.c @@ -217,7 +217,8 @@ write_png(int width, int height) CAIRO_FORMAT_ARGB32, width, height, buffer_stride); - fp = file_create_dated("wayland-screenshot-", ".png", filepath, sizeof(filepath)); + fp = file_create_dated(getenv("XDG_PICTURES_DIR"), "wayland-screenshot-", + ".png", filepath, sizeof(filepath)); if (fp) { fclose (fp); cairo_surface_write_to_png(surface, filepath);