jtheoof / swappy

A Wayland native snapshot editing tool, inspired by Snappy on macOS
MIT License
1.05k stars 39 forks source link

[Feature request] Autosave on close #107

Open kflak opened 3 years ago

kflak commented 3 years ago

Thanks for a great piece of very useful software!

Is it possible to configure swappy to automatically save an image on close?

AdjectiveAllison commented 9 months ago

This was implemented in this PR: https://github.com/jtheoof/swappy/pull/134

early_exit=true in config works exactly as you desired I believe.

tuanbass commented 7 months ago

This was implemented in this PR: #134

early_exit=true in config works exactly as you desired I believe.

Even with early_exit=true, the picture is not saved when I closed the window. I'm using

 swappy version 1.5.1-09a4e99 (Mar 10 2024, branch 'master')
 Ubuntu 22.04.3 LTS x86_64
 WM: sway 

command: grim -g "$(slurp)" - | swappy -f -

AdjectiveAllison commented 7 months ago

You're right @tuanbass. I read the originally requested functionality backwards.

early_exit makes it so that when you click the copy to clip board button or the save button the GUI automatically exits. Not when you exit it automatically saves.

The workflows seem the same to me: you would just click copy or save instead of exit and both of these buttons are in the top right corner. But I now understand why they are different conceptually.

tuanbass commented 7 months ago

You're right @tuanbass. I read the originally requested functionality backwards.

early_exit makes it so that when you click the copy to clip board button or the save button the GUI automatically exits. Not when you exit it automatically saves.

The workflows seem the same to me: you would just click copy or save instead of exit and both of these buttons are in the top right corner. But I now understand why they are different conceptually.

Thanks for the response, @AdjectiveAllison .

Unfortunately, the buttons does not work for me, as I'm using sway, for a mouseless centric workflow. Even I can use Ctr-s for saving (and also close the window with early_exit), I feel it's more nature to use my "Close window" shortcut than use Ctr-s to close window (and save).

How do you think about a setting to enable autosaving on close ? It should not be too difficult, as in the source code, you already call maybe_save_output_file in on_destroy, but for some reason, seem it does not work (may be the output path is not defined) .

tuanbass commented 7 months ago

I create a PR for this feature at #168.