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

A new file is created each time Save command is performed #169

Open
tuanbass opened this issue Mar 15, 2024 · 3 comments
Open

A new file is created each time Save command is performed #169

tuanbass opened this issue Mar 15, 2024 · 3 comments

Comments

@tuanbass
Copy link

tuanbass commented Mar 15, 2024

Step to reproduce:

  1. Ensure that early_exit=false
  2. Open swappy for an image (or make a screenshot)
  3. Ctrl-s to save
  4. Anther Ctr-s to save
  5. 2 png files, with same content are created

Expectation:

Only 1 file is created

@jtheoof
Copy link
Owner

jtheoof commented Apr 7, 2024

This is really on purpose based on timestamp when you save the file. We could generate an ID for each session but that could be seen as breaking change. What is wrong with the current behaviour?

@tuanbass
Copy link
Author

tuanbass commented Apr 10, 2024

This is really on purpose based on timestamp when you save the file. We could generate an ID for each session but that could be seen as breaking change. What is wrong with the current behaviour?

For example, in my case, I'm using swappy in sway for editing screenshot.
During editing session, I press Ctrl-S several time , just to ensure I dont loose my changes. So lots of pictures are created which really confuse me.

My 2 cents: it should behave similar to any normal editor (notepad, nano, vscode, word, photoshop ... ). For the first save, if file name not existed, the app could ask for a name or generating one. Afterward, the latest contents are saved into the same file.

@jerbaroo
Copy link

Instead of implementing one specific behaviour, this could be made more general so everybody can customize this how they like: take a parameter that allows a different command to be run when an image is saved.

# blah will be passed the temporary location of the saved file
swappy --save-file-with blah

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

No branches or pull requests

3 participants