Results 1 to 4 of 4

Thread: browser launcher script stopped working

  1. #1
    Join Date
    Apr 2007
    Beans
    122

    Question browser launcher script stopped working

    I use several different browsers, and I don't have a lot of memory, so I try to only have one open at a time. I wanted web pages to open in whatever browser was open at the time, so I created a shell script and set it as the default browser. It checks to see if any other browsers are running, and if not, it opens the page in Swiftfox (an optimized version of Firefox). This worked for quite a while, but recently it stopped working. Now it opens URLs in Swiftfox regardless of what else is running, and I can't figure out why. As far as I can tell none of the process names have changed, and I haven't edited the script. I'm not very experienced with scripting, so I'd really appreciate any help or insight. Thanks!

    The script:
    Code:
    #! /bin/bash
    
    if pidof swiftfox-bin
    then swiftfox $*
    else if pidof firefox
    then firefox $*
    else if pidof google-chrome
    then google-chrome $*
    else if pidof opera
    then opera $*
    else swiftfox $*
    fi
    fi
    fi
    fi

  2. #2
    Join Date
    Jul 2006
    Location
    London, UK
    Beans
    818
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: browser launcher script stopped working

    Now it opens URLs in Swiftfox regardless of what else is running
    Perhaps there is an instance of swiftbox already running?

    Check with
    Code:
    ps -Al | grep swift
    Otherwise, debug your script by trying each line, one at a time, from a terminal eg

    pidof firefox

    (which does not work for me I have to do pidof firefox-bin to get the PID

    I'm running 10.04.2

  3. #3
    Join Date
    Apr 2007
    Beans
    122

    Re: browser launcher script stopped working

    Well, it turns out that I was wrong on two counts: I missed the firefox issue (I hardly ever use plain firefox, so I never noticed) and at some point the main Chrome process changed from google-chrome to just chrome, and I didn't notice.

    Thanks so much for the help! This was a major annoyance while it lasted.

  4. #4
    Join Date
    Jul 2006
    Location
    London, UK
    Beans
    818
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: browser launcher script stopped working

    Thanks for the follw-up. Pleased you got it fixed.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •