-
-
Notifications
You must be signed in to change notification settings - Fork 74
feat: add input state persistence #213
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
base: master
Are you sure you want to change the base?
Conversation
66f40ac
to
27f148a
Compare
Add the ability to save and restore input text between sessions - save input text to state.ron when window closes - restore text when application launches - clear state when match is selected - add persist_state config option - add state_ttl_secs config option to expiry a saved state after some time - update documentation and examples - add home-manager module support
Thanks for your feedbacks, I'll change that ! To avoid a little delay at launch for first display of matches, I also wanted to save matches in the file (so having the save after the refresh_matches has been done), however I can't find a way to easily serialize which plugin has generated the match... |
So my last changes address all your feedbacks. I used I moved the I managed to save only when window will close, I think it is safe with anyrun since this is the main window. When it closes the program exits, and when we gracefuly kill the program, the window close event is also called. Finaly I used a |
EDIT: I solved that in last commit using signal-hook, I think it's the cleanest and neatest way to do that |
This feature allows to save and restore input text between sessions
persist_state
option (false
by default)state_ttl_secs
option (None
by default), duration after which the state is considered obsoleteUse case : when configured with keybind like
pkill anyrun || anyrun
, results are dismissed between sessions. It's disturbing when doing calculations with data in multiple place and not directly available on the screen.I've thoroughly testes thoses modifications without finding any bug, regression or issue.
Changes are totaly backward compatible, since a
persist_state
config option need to be enabled.Feel free to give me your feedback