Can xfce4-screenshotter be configured to save a screenshot without any GUI appearing?

Solution 1:

In order to take and save a screenshot without showing the GUI, xfce4-screenshot needs to be provided with the full path at which the screenshot should be saved, including the name of the file it should be saved as well as the folder it should be saved in.

You can provide it with this by generating a filename based on the current date using the command:

xfce4-screenshooter --fullscreen --save ~/Pictures/Screenshots/"Screenshot $(date -d "today" +"%Y-%m-%d %H:%M").png"

This should automatically take a screenshot and then save it as e.g. Screenshot 2021-12-01 00:00.png in ~/Pictures/Screenshots.

If you wish to activate this command via a keyboard shortcut, this will not work directly since it has to be run in a shell (e.g. bash), however, you should be able to create a shell script with the above command (by copying the command into a .sh file and making it executable) which you can then configure to execute for your chosen keyboard shortcut.

Solution 2:

With the --save option, the GUI should not be launched.

To control the saved file-name, there are two settings that you can add to the xfce4-screenshooter config file, ~/.config/xfce4/xfce4-screenshooter, which will allow you to change the default filename:

title=<YOUR_TITLE_HERE>
timestamp=<TRUE_OR_FALSE>

The title parameter will change the first part of the filename (defaults to "Screenshot") and timestamp will turn on or off the appending of the timestamp after the filename.

If you turn off the timestamp, the program is smart enough to append a -1, -2, -3 etc to the end of the filename, if a file exists with that name already.