My firefox script

Discussion in 'Python' started by Dfenestr8, Apr 7, 2004.

  1. Dfenestr8

    Dfenestr8 Guest

    Hi. I use mozilla firefox on linux. It's a great browser, but the *nix
    version has an annoying problem, that it won't let you open a new instance
    from the desktop if the browser is already running.

    So, in my amateurish way I wrote a little script to fix that. Here it
    is......


    #! /usr/bin/python
    #fox_launch.py

    import sys, os

    if len(sys.argv) > 1:
    URL = str(sys.argv[1])
    else:
    URL = ""

    a = os.popen("ps ax |grep firefox")

    detect_fox = a.read()

    if detect_fox.count("firefox-bin") > 0:
    os.popen2("firefox -remote 'openURL(" + URL + ",new-window)'")
    else:
    os.popen2("firefox " + URL)
     
    Dfenestr8, Apr 7, 2004
    #1
    1. Advertising


  2. > Hi. I use mozilla firefox on linux. It's a great browser, but the *nix
    > version has an annoying problem, that it won't let you open a new
    > instance from the desktop if the browser is already running.


    search freshmeat.net for "MSS"


    --
    Дамјан (jabberID:)

    Where do you think you're going today?
     
    =?UTF-8?B?0LTQsNC80ZjQsNC9INCzLg==?=, Apr 8, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leythos
    Replies:
    4
    Views:
    3,632
    Leythos
    Mar 30, 2005
  2. Replies:
    9
    Views:
    613
  3. Rajat
    Replies:
    3
    Views:
    747
    Jorgen Grahn
    Jan 8, 2010
  4. VYAS ASHISH M-NTB837
    Replies:
    2
    Views:
    603
    Jan Kaliszewski
    Jan 7, 2010
  5. VK
    Replies:
    9
    Views:
    123
Loading...

Share This Page