You are not logged in.
examon wrote:Hi guys! I started to use luakit some days ago and I really like it. One thing I've problem with is, that I can't setup 'downloading without asking'.
I set default download location with:
downloads.default_dir = os.getenv("HOME") .. "/down"
and this works ok. Now I wanted to set 'download without asking' so I added next block of code under 'default download location' code.
downloads.default_dir = os.getenv("HOME") .. "/down" downloads.add_signal("download-location", function (uri, file) if not file or file == "" then file = (string.match(uri, "/([^/]+)$") or string.match(uri, "^%w+://(.+)") or string.gsub(uri, "/", "_") or "untitled") end return downloads.default_dir .. "/" .. file end)
I was following 'FAQ' at luakit.org but 'downloading without asking' doesn't work.
Thanks for help
That should work, and you added it below the `require "downloads"` line in your rc.lua? And are you sure the correct rc.lua is being loaded? (run `luakit -v 2>&1 | grep "luaH_loadrc"`)
Thanks for reply mason.larobina!
I think correct rc.lua is being loaded. Becouse 'defaults download location' code is loaded and is working. But 'download without asking' for some reason isn't loaded or something.
I tested:
luakit -v 2>&1 | grep "luaH_loadrc"
luakit opens but it's still the same... 'download without asking' is not working.
Offline
mason.larobina wrote:examon wrote:Hi guys! I started to use luakit some days ago and I really like it. One thing I've problem with is, that I can't setup 'downloading without asking'.
I set default download location with:
downloads.default_dir = os.getenv("HOME") .. "/down"
and this works ok. Now I wanted to set 'download without asking' so I added next block of code under 'default download location' code.
downloads.default_dir = os.getenv("HOME") .. "/down" downloads.add_signal("download-location", function (uri, file) if not file or file == "" then file = (string.match(uri, "/([^/]+)$") or string.match(uri, "^%w+://(.+)") or string.gsub(uri, "/", "_") or "untitled") end return downloads.default_dir .. "/" .. file end)
I was following 'FAQ' at luakit.org but 'downloading without asking' doesn't work.
Thanks for help
That should work, and you added it below the `require "downloads"` line in your rc.lua? And are you sure the correct rc.lua is being loaded? (run `luakit -v 2>&1 | grep "luaH_loadrc"`)
Thanks for reply mason.larobina!
I think correct rc.lua is being loaded. Becouse 'defaults download location' code is loaded and is working. But 'download without asking' for some reason isn't loaded or something.I tested:
luakit -v 2>&1 | grep "luaH_loadrc"
luakit opens but it's still the same... 'download without asking' is not working.
When all else fails chuck a `print("I'm in here")` in the "download-location" signal function.
Edit: and which version of luakit are you using?
Last edited by mason.larobina (2011-07-16 18:46:27)
Offline
OK, so I tested:
print("I'm in here")
...without reaction
Im using:
luakit f3a2dbe
Offline
OK, so I tested:
print("I'm in here")
...without reaction
Im using:
luakit f3a2dbe
I remember the problem now. Fixed here.
You'll have to update to luakit-git in AUR or apply the above patch to /usr/share/luakit/lib/lousy/signal.lua
But you still should have seen a "I'm in here" being printed.
Last edited by mason.larobina (2011-07-16 19:38:12)
Offline
examon wrote:OK, so I tested:
print("I'm in here")
...without reaction
Im using:
luakit f3a2dbe
I remember the problem now. Fixed here.
You'll have to update to luakit-git in AUR or apply the above patch to /usr/share/luakit/lib/lousy/signal.lua
But you still should have seen a "I'm in here" being printed.
Thanks!
I installed luakit-git as you recommanded. Now it works flawlessly!
Offline
Berticus wrote:Lastly, I'm still having trouble with the follows script (contains leading zeroes, numbers don't update as I type part of the url). In my ~/.config/luakit/follow.lua, I set sort_labels to false.
See my follow-styles branch (http://github.com/karottenreibe/luakit/ … low-styles). That should solve the leading-zeroes issue.
I don't know what you mean by "numbers don't update as I type part of the url".
There is no matching against URLs, only against the text of the matched elements. Also the hint labels are not supposed to update when you type something for two reasons:
a) That's confusing (people who type more quickly might accidentally hit the wrong number)
b) It's not possible to implement this without substantial changes to the codebasebootleg wrote:Since the lastest changes in follow.lua, the alternative characters hack didn't work anymore, so I tried something.
Also see my follow-styles branch. It now features a follow style called `charset' that lets you have that functionality. To use it, insert this somewhere after requiring `follow.lua':
follow.style = follow.styles.charset("uietsrn")
Turnover was a little slow but this work has been merged in to the develop branch along with other following script improvements.
You can now control exactly how the labels are generated by what we call "following styles".
Here are some examples:
local s = follow.styles
-- Custom charset.
follow.style = s.charset("asdf")
-- Sort & reverse labels to evenly distribute their leading
-- characters (this is what I use).
follow.style = s.sort(s.reverse(s.charset("asdfqwerzxcv")))
-- Impractical but funny
follow.style = s.charset("01")
Here is an image of the last one.
Edit: And the default is still number labels & partial link text matching.
Last edited by mason.larobina (2011-07-20 09:23:46)
Offline
I'm wondering, what exactly has to be done to make luakit use userscripts? According to the wiki and the file userscripts.lua these files only have to be put in $XDG_DATA_HOME/luakit/scripts and you're good to go. Butit doesn't seem to work here.
Maybe I'm just picking scripts that don't work with luakit, so does anybody have an example script?
Offline
I'm wondering, what exactly has to be done to make luakit use userscripts? According to the wiki and the file userscripts.lua these files only have to be put in $XDG_DATA_HOME/luakit/scripts and you're good to go. Butit doesn't seem to work here.
Maybe I'm just picking scripts that don't work with luakit, so does anybody have an example script?
There are a couple of examples on the luakit.org wiki and I have many userscripts working. Be sure you have the correct "@include" lines in the header.
Can you post your non-working userscript that we can test?
Offline
Is there a way to have the `referer` header populated on new tabs/windows? I browsed the libsoup and webkit documentation and while I found a libsoup function for this (soup-message-headers-append()), I did not find any way to glue this back to webkit.
Offline
There are a couple of examples on the luakit.org wiki and I have many userscripts working. Be sure you have the correct "@include" lines in the header.
Can you post your non-working userscript that we can test?
I'm just too stupid, I put the scripts into ~/.config/luakit/scripts ... Should have gone to bed instead of playing with this ... Of course the scripts work fine after putting them into ~/.local/share/luakit/scripts. Sorry for the noise!
Offline
New luakit release 2011.07.22
Check out the changelog here:
Or browse the luakit-2011.07.22 source here:
https://github.com/mason-larobina/luaki … 2011.07.22
I've already reported the [community] packages as out-of-date so it shouldn't be too long before they are updated.
Enjoy guys.
Offline
Nice Many good new things in this release! Great work Mason and all other coders!!
Offline
As I have zero experience in lua nor the time to learn I figured I'd just ask here.
Would it be possible to integrate http://gpl.internetconnection.net/vi/ in a way that it can be called upon textarea's with a hotkey, and to make escape/ctrl+[ accessable to it while doing so?
Really loving this browser!
Offline
Really, the only thing we're missing in luakit is proper bookmark handling, with tags, and maybe keywords (like the ones in firefox), but mostly, tab completion on :open and :tabopen.
Fear me! I have root! Sometimes...
Offline
[…] but mostly, tab completion on :open and :tabopen.
Wait a minute, we've already have this feature. Take a look here:
http://ompldr.org/vOXFoOA
Just start to type ("linux" for example), press <Tab> - and you'll have it
Offline
Yeah, it completes on history and commands, but not on bookmarks.
Fear me! I have root! Sometimes...
Offline
Is there a nice way to use scroll marks like in vi? Did a quick search and found nothing, so I came up with this:
add_binds("normal", {
-- Marks
buf("^m.$", function (w, b)
local widg = w:get_current()
local which = string.sub(b, 2)
scrollmarks = scrollmarks or {}
scrollmarks[widg] = scrollmarks[widg] or {}
scrollmarks[widg][which] = widg:get_scroll_vert()
end),
buf("^'.$", function (w, b)
local widg = w:get_current()
local which = string.sub(b, 2)
scrollmarks = scrollmarks or {}
scrollmarks[widg] = scrollmarks[widg] or {}
if scrollmarks[widg][which]
then
widg:set_scroll_vert(scrollmarks[widg][which])
end
end),
})
I don’t consider this beautiful code but it works.
Offline
Have been looking around but found no mention except for some reference to libunique. Is there a way to make sure that all new windows become new tabs instead? Eg when I click on a news item in google news.
Offline
+1 for that, just wanted to ask the same thing.
Offline
Have been looking around but found no mention except for some reference to libunique. Is there a way to make sure that all new windows become new tabs instead? Eg when I click on a news item in google news.
Copy webview.lua to ~/.config/luakit and look for the window_decision function (line 192 for me). Comment out the entire if statement and replace it with just "w:new_tab(uri)".
Offline
Thanks Josh. Clear instructions, works flawlessly.
Since I have to comment out stuff I take it that this cannot be done in userconf.lua? (Just trying to learn...)
Offline
I have this in my rc.lua, right after require 'webview':
webview.init_funcs.window_decision = function (view, w)
view:add_signal("new-window-decision", function (v, uri, reason)
w:new_tab(uri)
return true
end)
end
Fear me! I have root! Sometimes...
Offline
Great! This works too. And I have one less file in my luakit folder. Thanks, mkaito.
Offline
I have a little problem, luakit doesn't start the first time after boot. The second try works. Here's what I get at the first try
% luakit
(luakit:1120): GLib-WARNING **: In call to g_spawn_sync(), exit status of a child process was requested but SIGCHLD action was set to SIG_IGN and ECHILD was received by waitpid(), so exit status can't be returned. This is a bug in the program calling g_spawn_sync(); either don't request the exit status, or don't set the SIGCHLD action.
** (luakit:1120): WARNING **: Unable to open a connection to the session bus: Abnormal program termination spawning command line `dbus-launch --autolaunch=e0c4c760e84c7eb0c5730fd4000001e0 --binary-syntax --close-stderr':
(luakit:1120): GLib-GIO-CRITICAL **: g_dbus_connection_call_sync: assertion `G_IS_DBUS_CONNECTION (connection)' failed
[1] 1120 segmentation fault luakit
Any ideas?
Offline
I'm quite sure that you will have to start a dbus session to fix this. If you use xinitrc to launch your window manager put this lines on top (or copy them from /etc/skel/.xinitrc)
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
Offline