[Techtalk] Accessing X program from virtual console

Conor Daly conor.daly-linuxchix at cod.homelinux.org
Sat Oct 1 08:35:32 EST 2005


On Fri, Sep 30, 2005 at 09:03:37PM +0100 or so it is rumoured hereabouts, 
David Sumbler thought:
> I tend to use virtual consoles (i.e. not running under X) for much of
> what I do - in particular, e-mail.  But I use Firefox as my main
> web-browser.
> 
> There is a bash script on the Firefox site, which opens a URL in a new
> tab if the URL is given as an argument.  The script reads:
> 
> /usr/bin/firefox -a firefox -remote "openURL($@,new-tab)" || exec /usr/bin/firefox "$@";
> 
> This works fine from a terminal running under X, but if I use it from
> a virtual console, it tries to run a new instance of Firefox (I
> think), and I get (with varying process numbers, of course):

I reckon you need to check out the 'check_running' function in the firefox
startup script.  See if you can figure out what it checks for and see is
there a console-only invocation that would allow you to identify a running
firefox.  If you can work that out, you should be able to design an
invocation to call in the 

if [ $ALREADY_RUNNING -eq 1 ]; then

section.

OTOH, I don't imagine you'd be able to invoke a new firefox process in X
if you're not in X though an 'xhost +localhost' might do something for
you...
 
Conor
-- 
Conor Daly <conor.daly at oceanfree.net>

Domestic Sysadmin :-)
---------------------
Hobbiton.cod.ie
 22:32:51  up 47 days,  7:24,  1 user,  load average: 0.02, 0.04, 0.04


More information about the Techtalk mailing list