Bug 473521

Summary: Add command line arguments to Spectacle to define which region to capture so no UI pops up
Product: [Applications] Spectacle Reporter: m.kurz
Component: GeneralAssignee: Noah Davis <noahadvs>
Status: REPORTED ---    
Severity: wishlist CC: andrevinicius9, kde, nate
Priority: NOR    
Version First Reported In: 23.04.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description m.kurz 2023-08-19 07:07:18 UTC
SUMMARY
***
I want to run Spectacle in the background to capture a region automatically (and then exit) without showing a UI at all. However currently, even when running with -b (background) mode, Spectacle always displays the region selection screen:

  spectacle -b -c -r -n

This runs spectacle in background, copies the screenshot of a region and does not display notifcations.
However, with -r the selection tool to select the region always pops up and I need to manually confirm the region to capture, even when in the spectacle config it is set to remember the last rectangular region.

Without -r (therfore capturing the whole screen) Spectacle does what expected and immediately quits after the screenshot was saved (not showing any UI).

I therefore suggest to allow -r to take optional arguments to defined the region, like "-r <top,left,width,height>", for example:
 
  -r 450,260,1324,690

***

STEPS TO REPRODUCE
1. spectacle -b -c -r -n

OBSERVED RESULT
1. UI with region selection pops up
2. Need to confirm the region to copy to the clipboard
3. Only then spectacle exits

EXPECTED RESULT
1. No UI pops up
2. I would NOT need to confirm anything, everything should be done automatically (either by using the last selected region if that config is saved or maybe better with optional arguments like -r <top,left,width,height>
3. spectacle exits

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux ARM
KDE Plasma Version:  5.27.7
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10