You are not logged in.
i have an interesting question. i'm trying to get an <Escape> after f (or fl) to clear the hints. I've adjusted the js script like this:
//Parse input: first argument is follow keys, second is user input.
var args = '%s'.split(' ');
var charset = args[0];
// pbrisbin 3/27/2010
if (charset == 'clear') {
removeAllHints();
} else {
followLinks(args[1]);
}
and indeed the following works perfectly:
@bind <Escape> = script @scripts_dir/follow.js 'clear'
but that overrides the default @set_mode command which is extremely inconvenient not to have. so i ask,
is there a way to bind two commands to one key, or is there an entirely different way i could go about this?
i've tried two bind lines, the last one just overules and i've tried '... = @set_mode; script @scripts_dir/follow.js 'clear'' and that does nothing.
/edit: bit of a hack:
#!/bin/bash
#
# pbrisbin 2010
#
# @bind <Escape> = spawn @scripts_dir/set-clear
#
# wrapper script to reset mode and clear any hints
#
###
. "$(dirname "$0")/common"
# uzbl command to clear all hints
doclear='js var elements = doc.getElementById('\''uzbl_link_hint_div_container'\''); if (elements) { elements.parentNode.removeChild(elements); };'
# uzbl command to reset mode
setmode='set mode ='
# debug
echo -e "$doclear\n$setmode" | to_socket
"common" sets the function to_socket. it works but the second command takes a second to run, if we reimplement Uzbl.run(); that'd be the better way to accomplish this. that said, the above could be easily abstracted to make it a simple "run multiple uzbl commands from one keybind" script, where the commands are passed as args from the config directly...
/edit2: changed script to not rely on any edits to follow.js.
Last edited by brisbin33 (2010-03-27 15:29:16)
//github/
Offline
i have an interesting question. i'm trying to get an <Escape> after f (or fl) to clear the hints. I've adjusted the js script like this:
//Parse input: first argument is follow keys, second is user input. var args = '%s'.split(' '); var charset = args[0]; // pbrisbin 3/27/2010 if (charset == 'clear') { removeAllHints(); } else { followLinks(args[1]); }
and indeed the following works perfectly:
@bind <Escape> = script @scripts_dir/follow.js 'clear'
but that overrides the default @set_mode command which is extremely inconvenient not to have. so i ask,
is there a way to bind two commands to one key, or is there an entirely different way i could go about this?
i've tried two bind lines, the last one just overules and i've tried '... = @set_mode; script @scripts_dir/follow.js 'clear'' and that does nothing.
/edit: bit of a hack:
#!/bin/bash # # pbrisbin 2010 # # @bind <Escape> = spawn @scripts_dir/set-clear # # wrapper script to reset mode and clear any hints # ### . "$(dirname "$0")/common" # uzbl command to clear all hints doclear='js var elements = doc.getElementById('\''uzbl_link_hint_div_container'\''); if (elements) { elements.parentNode.removeChild(elements); };' # uzbl command to reset mode setmode='set mode =' # debug echo -e "$doclear\n$setmode" | to_socket
"common" sets the function to_socket. it works but the second command takes a second to run, if we reimplement Uzbl.run(); that'd be the better way to accomplish this. that said, the above could be easily abstracted to make it a simple "run multiple uzbl commands from one keybind" script, where the commands are passed as args from the config directly...
/edit2: changed script to not rely on any edits to follow.js.
There is a really simple solution which has been added into the example config (for another purpose).
http://github.com/Dieterbe/uzbl/blob/ex … onfig#L164
Just add one more line:
@on_event ESCAPE script @scripts_dir/follow.js 'clear'
Offline
oh i see. thank you.
edit: for anyone that wants it:
@on_event ESCAPE @set_mode
@on_event ESCAPE js var elements = doc.getElementById('uzbl_link_hint_div_container'); if (elements) { elements.parentNode.removeChild(elements); }
@bind <Escape> = event ESCAPE
works much better, thanks.
Last edited by brisbin33 (2010-03-27 18:06:26)
//github/
Offline
I've committed a partial fix for this problem though it needs some more testing.
I'm using the uzbl-git aur package, and I still get this bug. When I open a new tab with `gn`, the last two events in socat are:
EVENT [3624-1] KEY_RELEASE n
EVENT [3624-1] FOCUS_LOST
There's no `FOCUS_GAINED` event to refocus the current tab.
Offline
Hi
I'm trying to modify the download.sh script to deal with different file types, I do not know programming and my attempt did not work, giving 'syntax error: unexpected end of file' Could someone please help me correct the code and/or explain, thanks
if echo "$url" | grep -E '.*\.torrent' >/dev/null;
then
( cd "$dest/rtorrent/torrents"; $GET "$url")
else if echo "$url" | grep -E '.*\.nzb' >/dev/null;
then
( cd "$dest/nzbget/nzb"; $GET "$url")
else
( cd "$dest"; $GET "$url")
fi
Offline
bash doesn't use if else if like that. you want 'if; then; elif; then; else; fi' but in your case i'd use a case (!pun).
case "$url" in
*.torrent) (cd "$dest/rtorrent/torrents"; $GET "$url") ;;
*.nzb) (cd "$dest/nzbget/nzb"; $GET "$url") ;;
*) (cd "$dest"; $GET "$url") ;;
esac
also, for the future, look into grep -q.
/edit: typesetting.
Last edited by brisbin33 (2010-03-28 01:00:22)
//github/
Offline
Thankyou brisbin33 much appreciated it works (but you already knew that ), it has however thrown up another issue in that the .nzb files are not downloading to the correct directory as they are not recognized. The output I get says:
Length: unspecified [application/x-nzb]
Saving to: `nzb-download.php?id=12345&nozip=1'
Therefore it ends up in the %dest directory, if I move it and append .nzb it starts a download. I am assuming this means uzbl does not know about this kind of file and am unsure how to make it do so.
Now checking the Uzbl wiki and reading through this long thread but any help appreciated
Cheers again
Offline
Hi
I'm trying to modify the download.sh script to deal with different file types, I do not know programming and my attempt did not work, giving 'syntax error: unexpected end of file' Could someone please help me correct the code and/or explain, thanksif echo "$url" | grep -E '.*\.torrent' >/dev/null;
then
( cd "$dest/rtorrent/torrents"; $GET "$url")
else if echo "$url" | grep -E '.*\.nzb' >/dev/null;
then
( cd "$dest/nzbget/nzb"; $GET "$url")
else
( cd "$dest"; $GET "$url")
fi
The actual problem in that is that you use "else if".
In the given case, you would have to use a second "fi", to end the "if" that started after the "else". That's why it says "unexpected end of file"; there's an if statement that's left open.
To be precise, your code is the same as this:
if testcmd
then
command
else
if testcmd
then
command
else
command
fi
#(the fi here is missing!)
The correct usage is "elif":
if testingcmd
then
command
elif testingcmd
then
command
else
command
fi
But the "case" statement which brisbin33 showed is cleaner in this situation anyway.
P.S.: The man page says "grep -q" is not fully portable. I use "grep > /dev/null 2>&1" myself, but you might say that's unnecessary...
``Common sense is nothing more than a deposit of prejudices laid down by the mind before you reach eighteen.''
~ Albert Einstein
Offline
Thankyou brisbin33 much appreciated it works (but you already knew that ), it has however thrown up another issue in that the .nzb files are not downloading to the correct directory as they are not recognized. The output I get says:
Length: unspecified [application/x-nzb]
Saving to: `nzb-download.php?id=12345&nozip=1'Therefore it ends up in the %dest directory, if I move it and append .nzb it starts a download. I am assuming this means uzbl does not know about this kind of file and am unsure how to make it do so.
Now checking the Uzbl wiki and reading through this long thread but any help appreciated
Cheers again
I've had what I think may be a similar issue, but with humble .doc and .pdf files. If I am correct, then what you end up downloading is a .php file that, when opened, looks like a login page - these .nzb files are behind some sort of authentication barrier that uzbl isn't sophisticated to get through with it's basic wget. It might be that you could add '--load-cookies $XDG_DATA_DIR/uzbl/cookies.txt' to the wget arguments in your download.sh, but that didn't work for me.
Offline
d2ogch3n wrote:Thankyou brisbin33 much appreciated it works (but you already knew that ), it has however thrown up another issue in that the .nzb files are not downloading to the correct directory as they are not recognized. The output I get says:
Length: unspecified [application/x-nzb]
Saving to: `nzb-download.php?id=12345&nozip=1'Therefore it ends up in the %dest directory, if I move it and append .nzb it starts a download. I am assuming this means uzbl does not know about this kind of file and am unsure how to make it do so.
Now checking the Uzbl wiki and reading through this long thread but any help appreciated
Cheers again
I've had what I think may be a similar issue, but with humble .doc and .pdf files. If I am correct, then what you end up downloading is a .php file that, when opened, looks like a login page - these .nzb files are behind some sort of authentication barrier that uzbl isn't sophisticated to get through with it's basic wget. It might be that you could add '--load-cookies $XDG_DATA_DIR/uzbl/cookies.txt' to the wget arguments in your download.sh, but that didn't work for me.
Thanks for the suggestion gaunt. I had added the cookies.txt to my download,sh script and it solved the problem regarding .torrent files which were as you say downloading as .php files, The .nzb files are also downloading as the correct files, I've checked with another browser (iron) they just are not being renamed xxx.nzb but saved as stated in my post above.
I really like Uzbl, it is my prefeered browser on this old machine, it does everything efficiently including fullscreen flash which no other browser I have tried copes with elegantly, I have it pretty much configured to my needs now, this small issue being the last one keeping me from using it exclusively. Hopefully as this project evolves this will be resolved by someone with more knowledge than me . Until then I'll keep following this thread and doing my own research.
Thanks to all the devs and contributors for this great app.
Offline
- since recently, the download script uses the content-disposition http header. aka: filenames of downloaded files make more sense.
- brisbin33: nice trick. we should probably integrate your 'clear' option and your @on_event trick
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
Is anyone aware of a sample config with emacsen keybindings ?
Offline
Is it possible to run UZBL in framebuffer (without X)?
Offline
Hi all,
Finally got around to using UZBL and am enjoying it immensely.
I've scoured the sample config files and this thread, and while I'm probably missing something quite obvious, I'm trying to figure out how to save the contents of the current page in uzbl (something similar to the "save page as" option in Firefox). It would be simple enough to send the url to wget, but that wouldn't always work for password protected sites.
In other words, is there a variable or script that can access the data already downloaded by uzbl (e.g., the html of the current page)?
Thanks.
Offline
The suggested formfiller binding for the 'once' action doesn't seem to be working.
@cbind zo = @formfiller once
The other formfiller actions are doing fine. Am I doing something wrong?
Last edited by quickfished (2010-04-16 14:01:01)
Offline
Ok, I'm running uzbl and trying to use the favicon.py script, but it won't work. I ran uzbl from a terminal and here's the relevant output:
Traceback (most recent call last):
File "/home/case/.local/share/uzbl/scripts/favicon.py", line 94, in <module>
open(fifo,'a').write('set icon = %s\n' % favicon_f)
IOError: [Errno 2] No such file or directory: ''
Since I'm no python guy (I guess I should learn ), could anyone help me out with what is going on? Thanks.
Clever Linux quote.
Offline
Hi all,
Finally got around to using UZBL and am enjoying it immensely.
I've scoured the sample config files and this thread, and while I'm probably missing something quite obvious, I'm trying to figure out how to save the contents of the current page in uzbl (something similar to the "save page as" option in Firefox). It would be simple enough to send the url to wget, but that wouldn't always work for password protected sites.
In other words, is there a variable or script that can access the data already downloaded by uzbl (e.g., the html of the current page)?
Thanks.
yes. that stuff is done in several scripts. one of which is the formfiller script.
Is it possible to run UZBL in framebuffer (without X)?
some people said so, there should be a package on AUR for this. uzbl-directfb or something
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
Does uzbl-tabbed work for anybody? For me it's a hit-or-miss kind of thing, mostly misses. This is what I get regardless of whether it works or not:
/usr/bin/uzbl-tabbed:554: GtkWarning: Unable to locate theme engine in module_path: "clearlooks",
self.window = gtk.Window()
/usr/bin/uzbl-tabbed:554: GtkWarning: Unable to locate theme engine in module_path: "mist",
self.window = gtk.Window()
{'cookie_jar': '/home/albert/.local/share/uzbl/cookies.txt',
'cookie_socket': '/home/albert/.cache/uzbl/cookie_daemon_socket',
'cookie_whitelist': '/home/albert/.config/uzbl/cookie_whitelist',
'daemon_mode': True,
'daemon_timeout': 0,
'use_whitelist': False,
'verbose': True}
uzbl-cookie-daemon: detected daemon listening on '/home/albert/.cache/uzbl/cookie_daemon_socket'
uzbl-event-manager: will auto close.
uzbl-event-manager: found pid file: '/home/albert/.cache/uzbl/event_daemon.pid'
uzbl-event-manager: event daemon already started with pid: 13631
(uzbl-core:9426): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",
(uzbl-core:9426): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",
(uzbl-core:9426): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",
(uzbl-core:9426): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",
(uzbl-core:9426): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",
(uzbl-core:9426): Gtk-WARNING **: Unable to locate theme engine in module_path: "mist",
Exception occured while executing script:
At (command):1: TypeError: Result of expression 'document.activeElement' [null] is not an object.
Exception occured while executing script:
At (command):1: TypeError: Result of expression 'document.activeElement' [null] is not an object.
That's with both my own and the default config. I also get that with uzbl=browser, but I think there's only been a handfull of times when it crashes right away.
Also, does it feel slightly slower than firefox to anyone else? I mean I get the wait, and that takes a while. But once it moves onto recv it's much faster. So I'm pretty sure webkit is performing as it should, but uzbl may be dragging down the speed somehow...
---Edit---
Woah, I can adjust the size of the textbox?! Is that a bug, or was it meant to be like that?
Last edited by Berticus (2010-04-27 04:23:49)
Offline
I'm using uzbl-tabbed with no issues. I get the Gtk warning when I pass URL to it from TTYtter, but otherwise it works as advertised.
And, yes - the resizable text box seems to be a feature of uzbl - I don't see it in Firefox...
Offline
I'm using uzbl-tabbed with no issues. I get the Gtk warning when I pass URL to it from TTYtter, but otherwise it works as advertised.
And, yes - the resizable text box seems to be a feature of uzbl - I don't see it in Firefox...
That is WebKit in general. You can do this in Safari and Chromium as well.
Offline
And, yes - the resizable text box seems to be a feature of uzbl - I don't see it in Firefox...
Firefox nightlies have it. For earlier versions, as is for pretty much everything when it comes to Firefox, there's an extension.
Offline
It seems now uzbl-browser doesn't work if I start it from dmenu. It works fine when I start it from terminal, get all the same warnings.
What I don't understand is why it needs icedtea, this is for the isitworking page. I suspect that's what's causing it to crash, although I don't know why it works in the terminal.
Offline
Uzbl now crashes immediately after it starts... (today i updated via pacman)
~>uzbl-core
uzbl-core: symbol lookup error: /usr/lib/libwebkit-1.0.so.2: undefined symbol: soup_message_set_first_party
~>uzbl-core -V
Commit: ae15d257a858fe27090f3e5798357aea2f5a76da
Anyone has seen this error?
Last edited by ptcek (2010-05-08 17:23:43)
Offline
oh i see. thank you.
edit: for anyone that wants it:
@on_event ESCAPE @set_mode @on_event ESCAPE js var elements = doc.getElementById('uzbl_link_hint_div_container'); if (elements) { elements.parentNode.removeChild(elements); } @bind <Escape> = event ESCAPE
works much better, thanks.
I'm trying to make Esc clear all hints but with no success.
I've addedd these line into the config file:
@bind <Escape> = event ESCAPE
@on_event ESCAPE @set_mode
@on_event ESCAPE script @scripts_dir/follow.js 'clear'
@on_event ESCAPE script @scripts_dir/follow_new_tab.js 'clear'
What am I doing wrong?
Thanks!
rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686
Offline