3

When taking a screenshot in Ubuntu 22.04 the image is not saved.

I pressed "Print Screen" key, selected the area, pressed the round button.

The image is available on the clipboard but is not saved to a file.

In the syslog the message appears:

gnome-shell[2715]: JS ERROR: Error capturing screenshot: Error: Array element (type filename) may not be null#012_storeScreenshot@resource:///org/gnome/shell/ui/screenshot.js:2066:48#012captureScreenshot@resource:///org/gnome/shell/ui/screenshot.js:2194:21#012async*_saveScreenshot@resource:///org/gnome/shell/ui/screenshot.js:1759:30#012_onCaptureButtonClicked@resource:///org/gnome/shell/ui/screenshot.js:1738:18#012Caused by: Error: Invalid element in array

Can this be fixed?

Mic
  • 254
  • Should be saved in ~/Pictures/Screenshots. – vanadium Jun 09 '22 at 07:24
  • @vanadium Nothing there for me. I had deleted ~/Pictures when I first installed, but put it back and rebooted. It didn't work. – Mic Jun 09 '22 at 07:38
  • 1
    Do you have right permissions in newly created folders? – Serg Jun 09 '22 at 09:59
  • @Serg I think so, they are drwxrwxr-x. For comparison, Desktop is only drwxr-xr-x. – Mic Jun 09 '22 at 10:07
  • It looks that also for me, starting from some update weeks ago, the inbuilt screenshot app has stopped saving pictures to the relative $HOME/Pictures/Screenshots folders (and, yes, XDG_PICTURES_DIR is configured correctly in its file...). Here is the syslog output: Aug 25 16:50:17 BELL gnome-shell[2588]: meta_window_set_stack_position_no_sync: assertion 'window->stack_position >= 0' failed Aug 25 16:50:20 BELL dbus-daemon[2367]: [session uid=1000 pid=2367] Activating via systemd: service name='org.freedesktop.Tracker3.Miner.Extract' unit='tracker-extract-3.service' requested by ':1.9' (uid=100 – Pasha Aug 25 '22 at 14:57
  • EDIT: I discovered that this is a LOCALISATION issue: the Screenshots folder has been abandoned in favour of a new localised one in my language.... so all images were being saved in the new folder below Pictures one.... of course no notification of this update, very bad!!! – Pasha Aug 25 '22 at 15:33

2 Answers2

6

The reason it is not anymore working is that deleting the "Pictures" folder and recreating the folder removed its "special status". Gnome Shell locates your "Pictures" folder based on the value of XDG_PICTURES_DIR in the file ~/.config/user-dirs.dirs.

  • Edit the file ~/.config/user-dirs.dirs
  • Make sure there is an entry for XDG_PICTURES_DIR that reads like XDG_PICTURES_DIR="$HOME/Pictures".
  • Log out then back in.

Now, the screenshot tool should work normally again. If no folder "Screenshots" is present in ~/Pictures, that folder will automatically be created.

vanadium
  • 98,427
0

In my system in such a case a file is saved in ~/Documents/Images with file name like "screenshot-2022-06-09 07:59.png". I use Ubuntu 22.04.

xpicto
  • 31
  • 1
  • 6
  • 1
    Yes, but you are not using Ubuntu 22.04, but an earlier version or another desktop environment. – vanadium Jun 09 '22 at 07:23
  • For me, nothing in ~/Documents/Images or ~/Pictures/Screenshots. I deleted those folders because I don't want them, but I put them back to check. – Mic Jun 09 '22 at 07:33