diff options
-rw-r--r-- | config.dot/luakit.link/rc.lua | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/config.dot/luakit.link/rc.lua b/config.dot/luakit.link/rc.lua index 755e68e..dd054b8 100644 --- a/config.dot/luakit.link/rc.lua +++ b/config.dot/luakit.link/rc.lua @@ -186,6 +186,22 @@ local userprefs = require "userprefs" -- -- Or open new window -- window.new(uris) --end -window.new(uris) + +-- Session environment variable +local luakit_session = os.getenv("LUAKIT_SESSION") + +-- Check if session was requested, otherwise open uris +if luakit_session then + local path = basedir() .. "/luakit/sessions/" + local session = require "session" + local file = path .. luakit_session + + if not lfs.attributes(path) then lfs.mkdir(path) end + session.session_file = file + + session.restore(false) +else + window.new(uris) +end -- vim: et:sw=4:ts=8:sts=4:tw=80 |