Showing posts with label Firefox. Show all posts
Showing posts with label Firefox. Show all posts

Friday, November 6, 2009

How to run multiple instances of Firefox

So this issue is widely talked about on the internet with a lot of lame solutions involving creating multiple profiles. I don't want to create multiple profiles. I want to open new instances of Firefox at will. Not new windows, entirely new instances, and I want to use the same profile for all of them.

My situation is I installed Ubuntu 9.10 with Gnome. I don't particularly like Gnome, but I'll suffer it for a while, I suppose. In Gnome, you can add nifty application launchers so a single click will start the app. For Firefox, if you make the application launcher and click it once, Firefox opens. If you click it again, you get this dreaded message:

"Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system."

Big fat lie, that is. If I open a terminal window, and type "firefox", I get a new instance. I can do this over and over and create as many new instances as I want. But I can't do it from the launcher, which is annoying.

So here is how to do it:

  1. Create this script:

    #!/bin/bash
    nohup /usr/bin/firefox > /dev/null 2>&1 &
    sleep 2

    The 'nohup' line starts Firefox as a separate instance, the 'sleep' line gives that instance enough time to get started before the terminal exits.
  2. Save it somewhere and make it executable. I put it in my ~/bin directory and named it "firefox".
  3. Create an app launcher by right clicking on your panel and picking "Add to panel" from the menu.
  4. From Accessories, add Terminal (yes, Terminal, not Firefox).
  5. Right click on the terminal icon, and choose "Properties".
  6. In the "command" box, it says "gnome-terminal". Add a space and type in "--execute /home/danson/bin/firefox" or whatever the path is for where you saved the script in step 2.
  7. Change the icon to the firefox icon.
Multiple Firefoxes!

Wednesday, July 22, 2009

Switched to LXDE

I took Openbox one step further and installed LXDE:

sudo apt-get install lxde

LXDE is a Lightweight X11 Desktop Environment. It looks pretty slick, and uses Openbox as the window manager. It also adds a few other things, like:

  • a session manager
  • a lightweight terminal
  • openbox for the window manager
  • a theme switcher
  • a network manager
  • a desktop panel
  • xscreensaver
I needed to do a little bit of customization right off the bat. The default web browser is "Web Browser", which is a Gnome project based on gecko. I prefer Firefox. The docs on lxpanel are pretty weak, so it's not obvious how to add things to it. You need a .desktop file, of which there are plenty in /usr/share/app-install and /usr/share/applications. It should be a matter of just point and click to pick the right desktop file, but it turns out lxpanel will only read desktop files from /usr/share/applications or /usr/local/share/applications. So I copied the firefox.desktop file from /usr/share/app-install to /usr/local/share/applications (this is a good place since this folder is likely empty or close to empty, so it is easy to figure out which desktop files are yours), then used the gui installer to add Firefox to the application launcher. I did the same with Thunderbird, and removed a couple of the pre-installed launchers.

The default install only creates 2 desktops, and I like 4. There is a nice gui configuration for Openbox, it allows changing the number of desktops to 4, but doesn't let you set wrapping, as in switching from desktop 1 to 2 to 3 to 4 to back to 1. To fix this, you need to edit the configuration file ~/.config/openbox/lxde-rc.xml. Find the keyboard bindings for "DesktopLeft" and "DesktopRight" and change the wrap element from "no" to "yes". You'll need to log out and back in for this to take effect, but prior to doing that, I want one more change.

In the past, I've always uninstalled Gnome's screensaver or KDE's screensaver and used xscreensaver. I've always used Ctrl-Alt-Delete to have xscreensaver lock the screen. To do that, edit lxde-rc.xml once again. There is already a keybinding setup that uses Ctrl-Alt-Delete, so I just replaced the command with "xscreensaver-command -lock". Now I log out and back in, and desktops wrap and xscreensaver locks.

There is probably a little more to configure, but the main things I want for usability are there.

I'm thinking seriously about uninstalling gnome altogether. I don't think I need it at all anymore.

Wednesday, July 9, 2008

Firefox 3 is pretty!

How to make Firefox 3 pretty.  This should work in Gnome and KDE:

1. Press Alt-F2 to get the 'run command' dialog.
2. Enter "gnomecc" to start Gnome Control Center.
3. When the Control Center starts, click on "Appearance" in the Look and Feel section.
4. Click on a theme. Instant prettiness!


Firefox 2 and 3 together

I tried to install FF3 a while back, but the default install from Ubuntu replaced FF2, which was irritating because some of the plugins that I use on a regular basis don't yet work with FF3. So here is how to install Firefox 3 while keeping Firefox 2 and all the nice plugins you have for FF2 running at the same time:

1. I assume you don't have FF3 even downloaded yet.
2. Open a terminal window.
3. Start FF2 with profile manager:
> firefox-2 -profilemanager
4. Make a note of the name of your default profile, it's probably named "default".
5. Create a new profile named FireFox3.
6. Uncheck the "Don't ask at startup" box, then start Firefox, then exit.
7. Edit your start up link for FF2. I'm using KDE, so I right-click on the icon and choose "Configure Firefox 2 button". In the "Command line arguments" box, enter "-no-remote -P default". Change "default" to the name of your default profile if it is different.
8. Go to www.mozilla.com and download FF3. Don't use a package manager, get the .bz2 file.
9. Unzip the downloaded file to wherever you want Firefox 3 to be installed. There is no installer, just unzip the file. I put mine in ~/apps/firefox-3.
10. Create a new link to FF3. In KDE, I right click on my panel, choose Panel Menu -> Add Application -> Add non-KDE application, then fill in the blanks. For the Executable, pick "firefox" from the directory you unzipped your download file into. In the "Command line arguments" box, enter "-no-remote -P FireFox3". Set the icon if you'd like.

That's it. Now FF2 will run as expected with all your plugins, and FF3 will run and be ugly, but fast.

Saturday, June 7, 2008

Downgrading Firefox

My recent upgrade to Hardy Heron installed Firefox 3. I tried to use it, I really did, but I couldn't use it. First, it's butt ugly. It doesn't follow my widget theme at all, it uses the clunky looking default gtk widget look. That wasn't the real problem though. My main issue is the extensions don't work. Part of my job includes web development, so I run firebug, web developer, and some other extensions all the time.

To downgrade:

1. Open synaptic, and mark remove completely for all the firefox 3 items you can find.
2. Apply the changes.
3. Install firefox 2.
4. Go into ~/.mozilla/firefox/weirdprofilename/extensions and remove all files.
5. Go into ~/.mozilla/firefox/weirdprofilename and remove extension.*
6. Start firefox, go to Tools - Add ons, and reinstall your plugins.

I have Firebug, Molybdenum, Measure It, Remove cookies for site, Selenium IDE, and Web Developer.

Thursday, June 5, 2008

Hardy Heron woes... Firefox

So the upgrade installed Firefox 3, which is a beta. While Firefox runs well, version 3 doesn't support several of the plugins/extensions I was using. In particular, I spent a couple of hours figuring out how to get Firebug to run in 3. Then I realized that Selenium doesn't work either. Then I realized that the version of Firebug for Firefox 3 doesn't work. I tried to downgrade to Firefox 2, but wasn't successful. I'll need to spend more time at that, since I do need to downgrade. I do need to run those plugins. I tried the naive approach of removing Firefox 3 with Synaptic, and then installing Firefox 2. All that did was wipe out all my cookies and didn't actually change the version of Firefox. I didn't have time to spend on figuring it out, but the bottom line is that I was surprised that Ubuntu forced an upgrade to a beta version of an app and lost existing functionality without asking.

While Firefox 3 seems to work well (the plugin/extension issue aside), it's butt-ugly. The components don't (can't?) follow the look and feel of the rest of my apps.