Created
August 7, 2012 13:45
-
-
Save johntyree/3285450 to your computer and use it in GitHub Desktop.
Automagically save current session with rc.lua.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function window.init_funcs.auto_session_save (w) | |
| w.tabs:add_signal("page-removed", function () | |
| if not session.closing then | |
| w:save_session() | |
| end | |
| end) | |
| session.closing = false | |
| session.old_close_win = w.close_win | |
| w.close_win = function (w, force) | |
| session.closing = true | |
| session.old_close_win(w, force) | |
| end | |
| end | |
| function webview.init_funcs.auto_session_save (view, w) | |
| view:add_signal("property::uri", function () | |
| w:save_session() | |
| end) | |
| end | |
| -- Save current window session helper | |
| window.methods.save_session = function (w) | |
| session.save({w,}) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment