Comments (7)
Hi
This needs careful thought - if the new confit after the reload no longer wants the stuff being preserved, we'll need to gc it somehow.
Cheers,
Chris Jones
On 10 Oct 2014, at 14:02, Peter van Dijk [email protected] wrote:
caffeinate would like this, also probably some other modules.
—
Reply to this email directly or view it on GitHub.
from hammerspoon.
Good point. Easy if we just allow strings and ints to persist, hard (impossible?) if we allow modules to persist any kind of object.
from hammerspoon.
Based on IRC discussion: how about one table that persists over reloads (but not restarts?), plus a flag to setup.lua (visible from init.lua) that tells the user whether this is a fresh start or not? Users/extensions would just save state to this table on any change (thus avoiding an 'on reload' hook).
from hammerspoon.
+1. I'd go for a table that persists over reloads, but not restarts. We have hs.settings for that, if people want to do that sort of thing.
I think ideally the flag would indicate "reload", "restart", "first" (the latter meaning that this is the first time HS has been launched since the computer was booted)
from hammerspoon.
Do we have any idea how we would persist a Lua table across a reload? Given that the table could contain almost anything!
from hammerspoon.
What's the problem with limiting it to basic types (float, string)?
from hammerspoon.
I don't think anyone is going to work on this issue - it can be worked around trivially by using hs.settings to store some ephemeral data and then clearing it as soon as it's been used.
from hammerspoon.
Related Issues (20)
- [bug] Hammerspoon (and forked child processes) can't see files in `/Applications` when launched as a Login Item HOT 10
- Unable to set global varable in Hammerspoon Lua HOT 13
- Hammerspoon crashes upon hs.reload(), and won't successfully execute again until macOS reboot
- Shift agruments in `hotkey.new`
- Is there a solution to implement SpaceFN
- Hammerspoon does not respond/hang when the frontmost application does not respond
- Feature Request: I would like to know if a modal is in the state active HOT 1
- Feature request: `:keydown` callback for `hs.chooser`
- Delete Preferences modal is confusing
- Moving Apps To Spaces HOT 2
- Memory is growing up to 2-4GB after some time - how to debug? HOT 1
- ** Warning: LuaSkin: hs.audiodevice.watcher callback fired, but theWatcher is nil. This is a bug
- ERROR: hotkey.lua:415: key must be a string or a number HOT 6
- Create Helper apps with Hammerspoon and sell it? HOT 2
- attempt to call a nil value (method 'setCallback')
- A way to prevent hs.alert.show() from stealing focus? HOT 1
- Unexpected behavior when moving a window with `moveToUnit` HOT 2
- hs.window:raise() focuses raised window when other window for same application is focused HOT 1
- hs.window.filter stops emitting windowFocused events for application if one window has tabs HOT 1
- Add functions to hs.mouse to get more information about cursor type HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hammerspoon.