Re: luakit browser framework (almost with jQuery!)

Hello, I have made an alternative session system. Instead of saving everything in one session file, save each window as a separate session file, analogous to vim and text files.

To use, download this file to your luakit config directory as session.lua. Install a json library; I use luajson installed through luarocks. Restart luakit and verify directory $XDG_DATA_HOME/luakit/sessions.d is created.

Commands (most of these take a session name as an argument),

:w - write current session to file, optional give a name to save as

:l - load a session, closes existing tabs in window

:m - merge a session into current; that is same as load but does not close existing tabs

:nl - load a session in a new window

:s - set new session name

:wq - write out and quit

:sname - show current session's name

ZZ - overloaded, does what's on the tin

The file format is plain json. The lua table is saved as is through a simple json.encode and includes history data. The name of the current session is stored in w.session. There is no automatic restore on start. Thanks to IsoLinCHiP from IRC for proofreading and suggesting a couple of changes.

Re: luakit browser framework (almost with jQuery!)

This may sound really stupid.. but every now and then when I visit a webpage a download dialog comes up for "fastbutton" (developers.google.com gives this to me, among others). And just recently I came across one that tried to download "badge" (dreamincode.net gives this to me). I don't think I have anything too foreign in my *.lua files, just wondering if anyone else has come across this or visiting those sites gives the same result, or perhaps just know where it stems from? It's not a "problem", it's just annoying to keep having these download dialogs pop up.

Re: luakit browser framework (almost with jQuery!)

@fsckd: Really like the alternative session management.. thanks.

Edit: @fsckd: I know you said it's not supported right now but is automatic restore on start a possiblity or is that undesired? If possible, maybe if user saves a session as "default" (or "auto" or some other predetermined name) it will be loaded on start? Also, is there a "delete session" option I didn't notice or is that not implemented and manual file removal intervention required?

Edit2: luakit's "restart" command has problems with the alternate session.lua by attempting to call method 'error', etc. Just a heads up.

luakit is saving the current state tot he session file and reloading it on restore. This does not fit with my alt sessions.

The solution I can think of is to rename the table to altsession and let luakit keep its session stuff. This would conflict with restoring a default session and as it is window session names would be lost.

Edit: Another solution, rename existing session.save and make a new session.save to write all browser state. Then restore can check for that, etc.

Re: luakit browser framework (almost with jQuery!)

I am not sure if this has been addressed previously but at some pages when using follow I get this message,

Error: /usr/share/luakit/lib/follow.lua:617: 'TypeError' 'undefined' is not an object (evaluating 'head.appendChild')

and right below a stack backtrack is listed.

Also related to follow is that this afternoon when reading some of the entries of this thread (thanks for that helpful flashblock script!!) I used follow a couple of times and they were followed erroneously. That is, follow code was 30 and Luakit followed a 10 one :-?

Finally, is some sort of autosave already implemented? If not, are there plans for it to be introduced?

Before I forget, could someone hint me how to personalize the 'show in folder' in 'Downloads' for the download folder I have defined according the steps in the Wiki (the Arch one)? I have taken a look at download.lua and download_chrome.lua but I seem to not be able to figure it out there :s

Re: luakit browser framework (almost with jQuery!)

Hi. I have a little problem with luakit, as normal user it doesn't connect to any page, as root, it works perfectly.I installed it like shown in the wiki, through pacman, and copy config files with: cp -r $XDG_CONFIG_DIRS/luakit $XDG_CONFIG_HOME

Re: luakit browser framework (almost with jQuery!)

Re: luakit browser framework (almost with jQuery!)

I don't know why you tried that. But if you don't want to answer troubleshooting questions I'm not sure how you expect to be helped. I assume if you knew what the problem *was* you wouldn't have asked here.

Re: luakit browser framework (almost with jQuery!)

Yes, it's kind of a "cutesy" name for a script. Basically, it sits as a bookmark until it is summoned! When the particular bookmarklet is activated, it executes a script on the current page (instead of taking the user to another page in the case of normal bookmarks).

As for luakit, I tried assigning it to a quickmark, and it works! Thanks for the tip!

Re: luakit browser framework (almost with jQuery!)

For me, luakit is agonizingly slow at web browsing. The browser itself is fast, but loading pages takes forever. Chromium, on the other hand is fast at loading pages. I really like luakit's interface (or rather, lack of one) but slow page load is a real deal breaker for me. Anyone know of a solution?

Re: luakit browser framework (almost with jQuery!)

mpnordland, more information would be needed. There should not be a difference. The only thing that comes to mind is if your network has ipv6 problems (this is fairly common and would make web page loading lag considerably) and chromium was set to use ipv4 only. To test this, disable ipv6 on your system and see if luakit works better.

Also, you can use wget/curl to download a web page or two, and see if they open quickly in luakit.