Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Autosave on close #107

Open
kflak opened this issue May 19, 2021 · 5 comments
Open

[Feature request] Autosave on close #107

kflak opened this issue May 19, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@kflak
Copy link

kflak commented May 19, 2021

Thanks for a great piece of very useful software!

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

@jtheoof jtheoof added the enhancement New feature or request label Sep 6, 2021
@AdjectiveAllison
Copy link

This was implemented in this PR: #134

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

@tuanbass
Copy link
Contributor

tuanbass commented Mar 15, 2024

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
Copy link

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
Copy link
Contributor

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
Copy link
Contributor

I create a PR for this feature at #168.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants