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

feat(config): add auto saving on app exit #168

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tuanbass
Copy link

No description provided.

Copy link
Owner

@jtheoof jtheoof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to update the man page too.

@@ -246,7 +246,7 @@ static void save_state_to_file_or_folder(struct swappy_state *state,
}

static void maybe_save_output_file(struct swappy_state *state) {
if (state->output_file != NULL) {
if (state->config->auto_save) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (state->config->auto_save) {
if (state->config->auto_save && state->output_file != NULL) {

Copy link
Author

@tuanbass tuanbass Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think we need to check NULL for state->output_file here, as in case output_file=NULL, in save_state_to_file_or_folder the file name is generated.

Actually, with the NULL check, at least in my case, the file is not auto saved.
I'm using swappy in sway using the command as specified in the README:

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

every time I make a screenshot, then I close the swappy, the filename is NULL so the picture is not saved.

README.md Outdated Show resolved Hide resolved
@jtheoof jtheoof changed the title feat: auto saving on quit app feat(config): add auto saving on app exit Apr 7, 2024
@jtheoof jtheoof self-assigned this Apr 7, 2024
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

Successfully merging this pull request may close these issues.

2 participants