Satty icon indicating copy to clipboard operation
Satty copied to clipboard

Early Exit only on enter action

Open cybercoder-naj opened this issue 1 year ago • 7 comments

I have two workflows when it comes to taking screenshots. I want to:

  1. Hit enter and close satty and save the file to ~/Pictures/Screenshots/$timestamp.png (which is done)
  2. Click on Copy and manually close it if needed.

The --early-exit flag exits on both copy and save. I wish this could be configured.

cybercoder-naj avatar Mar 18 '25 11:03 cybercoder-naj

Can you check if #174 solves your use case, please? You could use action-on-enter="save-to-file-and-exit" once it is merged.

RobertMueller2 avatar May 08 '25 14:05 RobertMueller2

@RobertMueller2 Do you think we should remove --early-exit at one point? I am wondering if we can factorize a bit

fabienjuif avatar May 08 '25 15:05 fabienjuif

I thought about this too because there's clearly an overlap, for now I'd probably keep it because it still has a use combined with the right-click-copy option. If that was an action, I think we wouldn't need it any longer. But of course it would break existing scripts. So maybe put a pin in it for now?

RobertMueller2 avatar May 08 '25 15:05 RobertMueller2

My 2 cents:

  • early-exit has been taken from Swappy. I never liked the name but functionality seemed useful
  • we should make sure that whatever we introduce is a "sane and solid" concept.
  • if we would introduce something new, then we should keep --early-exit and map its current behaviour to whatever replaces it internally. And yes, that means we will probably never remove it. We can declare it deprecated but removal will most likely never happen - and thats okay

gabm avatar May 08 '25 21:05 gabm

Makes sense. I was thinking of renaming/remaping all known CLI args shortcuts (like --right-click-copy) to action-on-{key} to be consistent and to leverage the actions system.

We then would have:

--action-on-enter
--action-on-escape
--action-on-right-click
[..more later but we can now be consistent..]

And maybe remove the --right-click-copy

WDYT?

fabienjuif avatar May 09 '25 07:05 fabienjuif

great idea.. so we have

triggers

--action-on-enter
--action-on-escape
--action-on-right-click

actions

which ones?

... what do we do with multiple/compound actions?

gabm avatar May 09 '25 13:05 gabm

For now we have these:

    SaveToClipboard,
    SaveToFile,
    SaveToClipboardAndExit,
    SaveToFileAndExit,
    Exit,

With *AndExit being created for the --action-on-escape.

But long term I was thinking of allowing lists in --action-on-*, like such: satty -f - --action-on-escape=save-to-clipboard,exit

fabienjuif avatar May 09 '25 13:05 fabienjuif