! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Feature Request: Add command-line option to automatically accept default file...
Status:
RESOLVED: DUPLICATE
Product:
Xfce4-screenshooter
Component:
General

Comments

Description Allan Bogh 2018-11-10 21:37:32 CET
When using the --save option, a file save dialog opens with the default filename filled in. 

It would be nice if there were a command-line option to automatically accept the default filename for --save (-s) and prevent the save dialog from displaying. Perhaps --accept or -a, or -y/--yes.
Comment 1 Andre Miranda editbugs 2019-01-05 22:38:07 CET
See bug 14156.

*** This bug has been marked as a duplicate of bug 14156 ***
Comment 2 Olivier 2019-08-13 21:25:46 CEST
Sorry, can you explain how  bug 14156 is supposed to solve this bug?
I believe it does not:
- This bug is about automatically accepting the suggested file name.
- Bug 14156 is about giving a file name from the command line.
Olivier
Comment 3 Andre Miranda editbugs 2019-08-14 06:05:29 CEST
(In reply to O.C. from comment #2)
> Sorry, can you explain how  bug 14156 is supposed to solve this bug?
> I believe it does not:
> - This bug is about automatically accepting the suggested file name.
> - Bug 14156 is about giving a file name from the command line.
> Olivier

xfce4-screenshooter -f --save "Screenshot_$(date +%Y-%m-%d_%H-%M-%S).png"
Comment 4 Olivier 2019-08-15 00:08:31 CEST
This looks like a good idea. But, if I associate the line that you suggest to an XFCE keyboard shortcut, the name of the file created will be literally "Screenshot_$(date +%Y-%m-%d_%H-%M-%S).png", with no shell expansion. Shell expansion does not seem to happen for keyboard shortcuts within XFCE. 
Since people usually  want to trigger screenshots with shortcuts, I still don't see how this "--save" option can be used conveniently in order to do what the original poster is asking.
Comment 5 Andre Miranda editbugs 2019-08-15 01:51:35 CEST
(In reply to Olivier from comment #4)
> This looks like a good idea. But, if I associate the line that you suggest
> to an XFCE keyboard shortcut, the name of the file created will be literally
> "Screenshot_$(date +%Y-%m-%d_%H-%M-%S).png", with no shell expansion. Shell
> expansion does not seem to happen for keyboard shortcuts within XFCE. 
Try: bash -c 'xfce4-screenshooter -f --save "Screenshot_$(date +%Y-%m-%d_%H-%M-%S).png"'

> Since people usually  want to trigger screenshots with shortcuts, I still
> don't see how this "--save" option can be used conveniently in order to do
> what the original poster is asking.
I prefer to keep what we already have because it is flexible enough: what if the users want the date in another format? What if they don't want the "Screenshot" prefix? What if they want it to be saved in another folder?
All of these preferences are allowed by the implemented feature, something like "--save-no-confirm" would be far more limited and require handling to complain when it and "--save" are used at same time.
Comment 6 Olivier 2019-08-16 16:07:47 CEST
Thank you. Your solution works and is indeed flexible.
I just wonder if it expensive in ressources to call `bash` every time.

Bug #14866

Reported by:
Allan Bogh
Reported on: 2018-11-10
Last modified on: 2019-08-16

People

Assignee:
Jérôme Guelfucci
CC List:
2 users

Version

Attachments

Additional information