You are not logged in.

#851 2010-03-27 15:02:24

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: uzbl. A browser that adheres to the unix philosophy.

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)

Offline

#852 2010-03-27 15:49:00

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: uzbl. A browser that adheres to the unix philosophy.

brisbin33 wrote:

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

#853 2010-03-27 17:58:42

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: uzbl. A browser that adheres to the unix philosophy.

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)

Offline

#854 2010-03-27 21:43:27

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: uzbl. A browser that adheres to the unix philosophy.

mason.larobina wrote:

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

#855 2010-03-28 00:43:32

d2ogch3n
Member
Registered: 2010-01-20
Posts: 42

Re: uzbl. A browser that adheres to the unix philosophy.

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

#856 2010-03-28 00:58:35

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: uzbl. A browser that adheres to the unix philosophy.

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)

Offline

#857 2010-03-28 01:55:38

d2ogch3n
Member
Registered: 2010-01-20
Posts: 42

Re: uzbl. A browser that adheres to the unix philosophy.

Thankyou brisbin33 much appreciated it works (but you already knew that wink ), 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 hmm but any help appreciated

Cheers again

Offline

#858 2010-03-28 12:00:13

kaptenen
Member
Registered: 2009-12-06
Posts: 287
Website

Re: uzbl. A browser that adheres to the unix philosophy.

Something like buftabs to save some space when using uzbl-tabbed whould be awesome. Is it a hard thing to integrate the statusbar with the tabs?

Offline

#859 2010-03-28 12:31:36

TaylanUB
Member
Registered: 2009-09-16
Posts: 150

Re: uzbl. A browser that adheres to the unix philosophy.

d2ogch3n wrote:

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

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

#860 2010-03-28 13:43:12

gaunt
Member
Registered: 2009-12-13
Posts: 62

Re: uzbl. A browser that adheres to the unix philosophy.

d2ogch3n wrote:

Thankyou brisbin33 much appreciated it works (but you already knew that wink ), 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 hmm 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

#861 2010-03-28 15:24:38

d2ogch3n
Member
Registered: 2010-01-20
Posts: 42

Re: uzbl. A browser that adheres to the unix philosophy.

gaunt wrote:
d2ogch3n wrote:

Thankyou brisbin33 much appreciated it works (but you already knew that wink ), 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 hmm 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 smile. 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

#862 2010-03-29 10:49:28

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: uzbl. A browser that adheres to the unix philosophy.

- 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

#863 2010-04-07 21:16:06

disturb
Member
Registered: 2009-12-18
Posts: 70

Re: uzbl. A browser that adheres to the unix philosophy.

Is anyone aware of a sample config with emacsen keybindings ?

Offline

#864 2010-04-11 20:00:19

RPMN
Member
Registered: 2010-03-08
Posts: 13

Re: uzbl. A browser that adheres to the unix philosophy.

Is it possible to run UZBL in framebuffer (without X)?

Offline

#865 2010-04-15 11:49:41

madalu
Member
Registered: 2009-05-05
Posts: 217

Re: uzbl. A browser that adheres to the unix philosophy.

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

#866 2010-04-16 14:00:43

quickfished
Member
From: Hong Kong
Registered: 2009-01-06
Posts: 29

Re: uzbl. A browser that adheres to the unix philosophy.

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

#867 2010-04-20 20:08:46

mahatman2
Member
From: Baton Rouge, LA, USA
Registered: 2010-03-04
Posts: 46
Website

Re: uzbl. A browser that adheres to the unix philosophy.

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 wink ), could anyone help me out with what is going on? Thanks.


Clever Linux quote.

Offline

#868 2010-04-20 21:05:49

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: uzbl. A browser that adheres to the unix philosophy.

madalu wrote:

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.

RPMN wrote:

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

#869 2010-04-27 04:22:17

Berticus
Member
Registered: 2008-06-11
Posts: 731

Re: uzbl. A browser that adheres to the unix philosophy.

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

#870 2010-04-27 04:27:54

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: uzbl. A browser that adheres to the unix philosophy.

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...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#871 2010-04-27 07:20:20

quickfished
Member
From: Hong Kong
Registered: 2009-01-06
Posts: 29

Re: uzbl. A browser that adheres to the unix philosophy.

jasonwryan wrote:

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

#872 2010-04-27 08:29:08

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: uzbl. A browser that adheres to the unix philosophy.

jasonwryan wrote:

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

#873 2010-05-05 16:23:57

Berticus
Member
Registered: 2008-06-11
Posts: 731

Re: uzbl. A browser that adheres to the unix philosophy.

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

#874 2010-05-08 17:22:59

ptcek
Member
From: Prague
Registered: 2008-07-11
Posts: 7

Re: uzbl. A browser that adheres to the unix philosophy.

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

#875 2010-05-08 18:06:58

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: uzbl. A browser that adheres to the unix philosophy.

brisbin33 wrote:

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

Board footer

Powered by FluxBB