LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-08-2004, 08:34 AM   #1
KlaymenDK
Member
 
Registered: Sep 2003
Location: Denmark
Distribution: FreeBSD v6.0
Posts: 123

Rep: Reputation: 15
Mozilla browser/mail sessions?


Hi all,
I'm failry new to Linux, still trying out what distros work best for me. I have one annoying problem that's the same on all distros though, and I figured you guys could probably solve it in a heartbeat. Perhaps I should go find the Moz forums for this, if so please let me know.

So ... say I've got Mozilla (v1.6) running as a browser, and I want to check my mail.
If I click the "Mail" icon in the "Component Bar" (you know, in the lower left of the browser window you can launch mail/composer/addresses/etc) then Mozilla Mail starts up in a new window as I would expect, and I can do web and in parrallel.
But if I instead click the separate Mozilla Mail icon on the desktop or K-menu, it'll ask me what user profile to use, and it won't accept the one I'm already using because it's busy (well duh).

Help! How do I make Linux understand I want to use the same session, and just spawn a new instance?

ThisworksjustfineinWindowsmuttermutter...

As I said, I'm new to Linux, but I can tell you I'm (presently) using SuSE 9.0, Mandrake 9.2, Mozilla v1.6, KDE and everything else are standard versions of those distro levels).

Cheers,
KlaymenDK
 
Old 03-08-2004, 01:35 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
You can make mozilla open in a new window if you use the remote options:
http://www.mozilla.org/unix/remote.html

There are a few scripts about that will automate this process and start a new session if required.
 
Old 03-08-2004, 01:59 PM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Ok I just had a look and couldn't actually find a nice simple one so I wrote this:
Code:
#!/bin/bash

# Change this to point to the mozilla executable
mozilla="/usr/bin/mozilla"

# See if mozilla is running
$mozilla -remote "ping()"
if [ $? == 0 ]; then
 # Mozilla is running
 if [ "$1" == "mail" ]; then
  # Open the mail client
  $mozilla -remote "xfeDoCommand (openInbox)"
 else
  # Open a new browser
  $mozilla -remote "xfeDoCommand (openBrowser)"
 fi
else
 # Mozilla is not running
 if [ "$1" == "mail" ]; then
  # Open the mail client
  $mozilla -mail
 else
  # Run with user default
  $mozilla
 fi
fi
 
Old 03-08-2004, 03:13 PM   #4
KlaymenDK
Member
 
Registered: Sep 2003
Location: Denmark
Distribution: FreeBSD v6.0
Posts: 123

Original Poster
Rep: Reputation: 15
Wow ... what can I say ... I'm much impressed with your script writing skills. I've examined your code and compared it to the page you linked to, and of course in retrospect it makes okay sense -- but I'd never have found that out by myself. Thank you. (Note to self: spread the word that this is a great forum.)

It all seems rather advanced compared to good ole batch files. Is this comparable to a run-of-the-mill quick-batch-file-to-run-your-fave-app-with-your-fave-options or is it a tad more advanced? I mean, if this is the standard I'll never get the hang of this!

Standard newbie questions:
- Where do I save that script to?
- How do I attach that script to a desktop or menu icon?

Thanks!

Oh btw, that "if"...""fi" thing has me on the floor!
 
Old 03-08-2004, 03:23 PM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It can't be as simple as writing a quick batch file. I just added a few options so that you could start either the mail client and or a browser window.

To install (you need to be root):
1) Save the above script as "/usr/local/bin/start-mozilla"
2) make sure that your mozilla binary is called /usr/bin/mozilla (change it in the script if needed)
3) Make the script executable "chmod 755 /usr/local/bin/start-mozilla"

You should then be able to run:
start-mozilla
or
start-mozilla mail

To create the shortcut you can right click on the kde panel and "Add -> Special Button -> Non KDE Application" locate the start-mozilla script. Then if you want a special one to open mail then in the box that appears next just type "mail".

EDIT: Yes! Please do spread the word

Last edited by david_ross; 03-08-2004 at 03:25 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
A Question on Browser Sessions, and Browser Windows: opioid Programming 1 09-23-2004 02:53 PM
Importing mail from Kmail to Thunderbird or Mozilla mail equus Linux - Software 3 07-30-2004 03:52 PM
Peserving PHP Sessions thru browser windows linux_pioneer Programming 1 06-01-2004 11:08 AM
Transferring Mozilla from win / Mozilla Mail filters? vahan Linux - Software 1 03-30-2004 08:34 AM
howto get firebird to open link in mozilla mail instead of mozilla? breadbin Linux - Software 1 09-13-2003 04:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration