Saturday, September 30, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  4] [ 0]  / answers: 1 / hits: 761  / 1 Year ago, wed, september 7, 2022, 6:13:56

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?

More From » 22.04


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.

[#438] Thursday, September 8, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 396
Total Questions: 90
Total Answers: 106

Location: Saint Lucia
Member since Sun, Sep 5, 2021
2 Years ago
biryanrownies questions
Fri, Dec 3, 21, 02:50, 2 Years ago
Sat, Feb 12, 22, 16:02, 2 Years ago
Sat, Apr 15, 23, 09:22, 6 Months ago