You are not logged in.
I'm trying to disable the status bar and show it only when the page is loading or if the mouse cursor is over the link. I changed 'link_hover_display' section in webview.lua to
link_hover_display = function (view, w)
view:add_signal("link-hover", function (v, link)
if w:is_current(v) and link then
w:update_uri(v, nil, link)
end
w.sbar.ebox:show()
w.sbar.hidden = false
end)
view:add_signal("link-unhover", function (v)
if w:is_current(v) then
w:update_uri(v)
end
w.sbar.ebox:hide()
w.sbar.hidden = true
end)
end,
but it does nothing. In the terminal are these messages:
W: luakit: luaH_dofunction:104: error while running function
stack traceback:
error: /home/ok/.config/luakit/webview.lua:85: attempt to call method 'is_current' (a nil value)
W: luakit: luaH_dofunction:104: error while running function
stack traceback:
error: /home/ok/.config/luakit/webview.lua:92: attempt to call method 'is_current' (a nil value)
I also want to show scroll marker in the window title, but the wiki page http://redmine.luakit.org/projects/luak … ndow_Title seems to be outdated. Does anybody know how to do it?
Edit: in window.lua:
update_scroll = function (w)
...
local title = w.view.title
local uri = w.view.uri
w.win.title = "[" .. w.sbar.r.scroll.text .. "] " .. (title or "luakit") .. ((uri and " - " .. uri) or "")
end,
Last edited by OK100 (2012-04-09 06:37:19)
Offline
Offline
Update your webview.lua. 'w:is_current(v)' is now 'w.view == v' and 'w:update_uri' now only takes link as an argument.
I changed it to
-- Display hovered link in statusbar
link_hover_display = function (view, w)
view:add_signal("link-hover", function (v)
if w:view == v and link then
w:update_uri(link)
end
w.sbar.ebox:show()
w.sbar.hidden = false
end)
view:add_signal("link-unhover", function (v)
if w:view == v then
w:update_uri(v)
end
w.sbar.ebox:hide()
w.sbar.hidden = true
end)
end,
but now I get this:
error loading module 'webview' from file '/home/ok/.config/luakit/webview.lua':
/home/ok/.config/luakit/webview.lua:85: function arguments expected near '=='
E: luakit: main:184: no windows spawned by rc file, exiting
Offline
Sorry, I got w:view instead of w.view . Thanks for your help.
Offline
Are you using luakit from [community] or a more recent version?
With the [community] version I don't have any problem viewing facebook pages - though clicking on a result in the search bar is another story.
I am using the git version.
Offline
Is it possible, when I close a tab to activate a tab that was focused before (like the default behavior in opera)? It currently focus a tab on the right.
Offline
I have problem with last.fm discover mode (http://www.last.fm/discover). It loads fine, but when I try to play something I can't hear anything and the progress bar on the bottom isn't moving.
Offline
@sonkei: sorry mate for not getting back but it works great! THanks
Clever Linux quote.
Offline
i often open a bunch of pages quickly in succession, but sometimes focus is lost while i'm opening a new tab, and i have to click the command bar to start typing again. does anyone else have this issue?
Offline
I'm having trouble with the script posted on the wiki to use cclive and mplayer to watch youtube vids.
I've put the following in my binds.lua:
-- Grab video
key({}, "v", function (w)
local view = w:get_current()
local uri = view.hovered_uri or view.uri
if uri then
luakit.spawn(string.format("urxvtc -e cclive -f best --filename-format '%%t.%%s' " .. "--output-dir %q --exec='mplayer \"%%f\"' %q",
os.getenv("HOME"), uri))
end
end)
When I try to run it, I get an error in my "attempt to call 'get_current' (a nil value)".
I also tried using get_current().uri
I installed luakit yesterday or the day before using the git repo. Does anyone know what the proper code should be?
EDIT: I've been looking through the thread, and it seems like there is a way (theoretically) to get luakit to do this automatically on page load using something like this:
webview.init_funcs.youtube_appender = function (view, w)
view:add_signal("navigation-request", function (v, uri)
if string.match(uri, "youtube%.com/watch%?v=") and not string.match(uri, "&html5=1") then
v.uri = uri .. "&html5=1"
return false
end
end)
end
but I'm not familiar with lua, and I'd like to attach something like this to a key in bind.lua instead of having it done automatically in webview.lua. Any suggestions?
EDIT 2: [SOLVED] my own issue... took quite a bit of digging though. It looks like get_current() is no longer a function (I dunno if anyone can confirm that), so I got it working using the following:
-- Grab video
key({}, "v", function (w)
local uri = w.view.hovered_uri or w.view.uri
if uri then
luakit.spawn(string.format("urxvtc -e cclive -f best --filename-format '%%t.%%s' " .. "--output-dir %q --exec='mplayer \"%%f\"' %q",
os.getenv("HOME"), uri))
end
end)
The change is deleting the line that had get_current() before, and changing
local uri = view.hovered_uri or view.uri
to
local uri = w.view.hovered_uri or w.view.uri
on the next
Last edited by rlevArch (2012-04-15 16:49:50)
Offline
I'm also finding that I have trouble seeing the follow hints sometimes... does anybody know how to change the opacity of the hints or somehow give the hints better contrast so I can see what they are?
Thanks
EDIT: Found my answer, thanks to Army for all these little tidbits of code earlier in the forum.
For anyone else who may need it, add this to theme.lua:
-- hints theming
theme.follow = {}
theme.follow.focus_bg = "#00ff00";
theme.follow.normal_bg = "#ffff99";
theme.follow.opacity = 0.3;
theme.follow.border = "1px dotted #000000";
theme.follow.frame_border = "2px solid #880000";
theme.follow.tick_frame_bg = "#880000";
theme.follow.tick_fg = "#ffffff";
theme.follow.tick_bg = "#000000";
theme.follow.tick_border = "2px dashed #000000";
theme.follow.tick_opacity = 0.35;
theme.follow.tick_font = "9px terminus";
theme.follow.vert_offset = 0;
theme.follow.horiz_offset = 0;
Last edited by rlevArch (2012-04-15 16:14:13)
Offline
I've been noticing an issue with the focusing. I'm not sure where I saw it, but I noticed someone else also comment on it. After opening a link, a new tab will open but the focus will be in the previous tab, or something like that. It's a relatively minor issue but it can get annoying.
Is there anyone actively working on this project?? The IRC channel was pretty dead when I checked it out for the above questions, and this thread seems pretty quiet...
Offline
At this time Facebook doesn't work for me, I have tried various solutions but nothing...I hope in your help
UPDATE: I solved my problems witht Facebook...I have to change the global user agent from chrome user agent to opera user agent. Now the site works well. Now I am searching a FlashBlock but I think it is difficult to find it. Any ideas?
Offline
Flashblock is built in in luakit! Here's what I have in my rc.lua
require "noscript"
noscript.enable_scripts = false
noscript.enable_plugins = false
This way plugins and javascript is disabled by default. To enable javascript for the current domain type ,ts and to enable plugins type ,tp
Sometimes I run into problems with this, e.g. if javascript from other domains is needed for the current webpage, but for those I use surf anyway, surf is my "all-allowed-browser" (and firefox my "all-allowed-and-doesn't-work-with-surf-browser")
Offline
Thanks Army. I know this method, but I prefer to block flash contents without noscript. Perhaps we need a script.
Today I have some crashes when I search in Facebook's bar. At this moment I have some issues also in Twitter
Last edited by Draven94 (2012-04-20 19:48:31)
Offline
I think that hasbeen asked bevfore, but I'm unable to find an answer. I use a dark gtk-theme, but several input fields in luakit have a dark background and black font. How do I fix this? I guess I need to apply a custom css but I'm a complette noob regarding this, so could anyone provide one for me please?
Offline
@Draven94, afaik there are userscripts which provide this funcionality? Luakit is able to handle userscripts, so you could take a look at http://www.userscripts.org
Offline
@Draven94, afaik there are userscripts which provide this funcionality? Luakit is able to handle userscripts, so you could take a look at http://www.userscripts.org
Thanks.
This scripts (http://userscripts.org/scripts/show/46673) works well.
Offline
I'm having another issue with luakit... youtube is very finnicky, and the vids only seem to work if there is an ad before the video. I can d/l it with cclive, but I don't always want to do that. Javascript and Plugins are both definitely enabled.
Also, is there anywhere else I can go for quicker help? The irc channel is always extremely quiet.
I'm also still having that issue with the focusing thing. Sometimes when a page loads or I open a new tab, none of the binds work because the page is not in focus and I have to click with the mouse.
Offline
Since I've begun using luakit as my "light" browser I'm experiencing a painful issue. When I open an arbitrary download link, the "Save as..." dialog appears. However, the content of the dialog window is not being rendered, just the window frame fulfilled with gray is. How could I fix that?
The luakit configuration is default, the package version is 2012.03.25-2, the recent one. I use awesome WM as my WM.
Thanks for any hints!
Offline
Since I've begun using luakit as my "light" browser I'm experiencing a painful issue. When I open an arbitrary download link, the "Save as..." dialog appears. However, the content of the dialog window is not being rendered, just the window frame fulfilled with gray is. How could I fix that?
The luakit configuration is default, the package version is 2012.03.25-2, the recent one. I use awesome WM as my WM.
Thanks for any hints!
I'm experiencing the same issue. The item will download if I just click enter, or cancel if I click esc, but the dialog window itself is grey and blank
Offline
This bug is still there?! That's the reason why I changed the download behavior. Put this code into the ~/.config/luakit/rc.lua (somewhere below downloads.default_dir = os.getenv("HOME") .. "/Downloads") and luakit will immediately download the file to this directory.
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)
Now I love this behavior, moving the files with ranger after the download is an easy and quick task.
Please file a bugreport for this (upstream, not on the archlinux bugtracker!), since it's really annoying! And now that I'm writing about it, luakit used to crash here after the download window appeared in grey and I hit Enter.
Last edited by Army (2012-05-05 06:34:40)
Offline
Another workaround for the download 'bug' that I've found: When you get that grey box, it's because the link is a downloadable file not a url that can be opened. If you press Esc, then right click on the item/link and select "download linked file" it works as expected giving a proper file dialog.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Online
Ok I'll try to make this youtube thingy work.
Hey Army, do you every get youtube links working with youtube-viewer? I just discovered this app, and if you did, I'd appreciate the code.
Thanks!
Offline
Dude that quote is old No I didn't implement this, because it doesn't make sense anymore (my internet is too slow for youtube). But I know how it can be done, although it's not perfect.
webview.init_funcs.youtube_hook = function (view, w)
view:add_signal("navigation-request", function (v, uri)
if string.find(uri, "youtube%.com/watch") then
luakit.spawn(string.format("youtube-viewer %q", uri))
return false
end
end)
end
Put this into the ~/.config/luakit/rc.lua, somewhere after the last "require" line (require "go_up").
Last edited by Army (2012-05-06 09:01:30)
Offline