Lynx as url viewer in Alpine

General talk about packaging procedures and packages.
Post Reply
User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

Lynx as url viewer in Alpine

Post by globetrotterdk »

Any idea how to get lynx to open in another buffer, when using it as a url viewer in Alpine? As it is now, I have to quit lynx to return to Alpine. I assume that this would be done by using switches in the url-viewer option section, but I am at a loss. I am using version 2.02 of re-Alpine.
Military justice is to justice what military music is to music. - Groucho Marx
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Lynx as url viewer in Alpine

Post by mimosa »

I had just the same problem with Vimprobable. The thing to do is call it with a script. So in Alpine's settings, where you now have lynx, substitute "lynx_launcher". Then create the file lynx_launcher somewhere in your path (by convention, /usr/local/bin), remembering to make it executable:

Code: Select all

#!/bin/sh
export http_proxy=http://localhost:8118/
/usr/bin/vimprobable2 "$@" 2> /dev/null &
The second line is because I use privoxy, so if you don't leave it out. But the key thing is the '&' at the end which backgrounds the process, so you return to Alpine. The "$@" passes an argument to the app, in this case the URL.

Obviously replace "vimprobable2" with the app name - it's almost certainly in /usr/bin

EDIT

Actually, lynx is a CLI app, isn't it, so that means you need to call it in an xterm:

/usr/bin/xterm -e lynx "$@" 2> /dev/null &

I'm pretty sure that's the correct way. :) EDIT not quite - tested and corrected. This works here.
User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

Re: Lynx as url viewer in Alpine

Post by globetrotterdk »

mimosa wrote:Actually, lynx is a CLI app, isn't it, so that means you need to call it in an xterm:
/usr/bin/xterm -e lynx "$@" 2> /dev/null &
I'm pretty sure that's the correct way. :) EDIT not quite - tested and corrected. This works here.
Hi mimosa, thanks for the response. If I understand this correctly,

Code: Select all

2> /dev/null
creates the second buffer? So would,

Code: Select all

3> /dev/null
create two buffers? How does one navigate between the buffers?
Military justice is to justice what military music is to music. - Groucho Marx
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Lynx as url viewer in Alpine

Post by Shador »

No 2> just redirects stderr and /dev/null is on a linux system what the Sahara is to water (barrel without bottom). 2 is the number of the file descriptor and by definition that is stderr (error output). 3> just would redirect the 3rd file descriptor which is not used so it does nothing.

Don't know about alpine and buffers, sorry.
Image
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Lynx as url viewer in Alpine

Post by mimosa »

Your recent post on fim made me realise (I think) you want to do this *without X*. I don't know if it's doable as such (and if it is might require a little script) but on the assumption you're running Alpine within screen (which works quite happily in the framebuffer) I think you could just have in place of

/usr/bin/xterm -e lynx ...

/usr/bin/screen lynx ...

and this would probably work fine in a terminal emulator too - but only as long as you were running alpine inside screen. If not, possibly it would still work but you wouldn't be able to get back to alpine without closing the browser. I'm sure it would be possible to write a script to check and if not, fall back on calling the browser in an xterm (or directly if using the framebuffer).

Anyway, it might be worth a try with screen.

By the way, I installed fim recently, and it was easier than the readme files make it seem. There's then a lot of tinkering you can do. Note that you need to create the configuration file at ~/.fimrc - there's one they made to start you off somewhere in there. However, even without, it does the basic job of viewing iamges. I have it set as my image viewer in alpine. :)
User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

Re: Lynx as url viewer in Alpine

Post by globetrotterdk »

Cool. Thanks for the info. Yes, I am considering using FIM in that context, but I was thinking of using the re-Alpine, FIM, Lynx combo with tmux. Did you build FIM from source?
Last edited by globetrotterdk on 17. Feb 2012, 14:29, edited 1 time in total.
Military justice is to justice what military music is to music. - Groucho Marx
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Lynx as url viewer in Alpine

Post by mimosa »

Yes, fim from source. I've since tried out the way I suggested with screen, but it didn't work; however it's fine with xterm, and I'm enjoying trying out lynx as my alpine broswer. However, perhaps you'll have more success with tmux. :) Please post any solutions you devise!
Post Reply