Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi everyone. I am totally new to Shell Scripting but I want to write a little script to set Operas integrated email program as the default mail program in Fedora 10. As it is an integrated component of the browser it currently doesn't appear in the list of mail programs in the Fedora GUI. I propose to set the default mail program as a shell script which will call up Opera Mail. I want the script to check to see if Opera is open, and if so, open Opera Mail using the remote command. If Opera is not open it should firstly open Opera and then open Opera Mail using the remote command.
Is there any way to check if a program is running from the terminal? Is there a log file or something that just lists running software perhaps? Sorry for such a noob question but you can't learn new things without starting somewhere. It will be very useful to be able to properly link Opera Mail with the Mail Notification panel applet.
Thanks in adbance for any help,
Eoin.
Yeah, thanks for the reply Chris. For anybody else who wants to be able to click on the mail notification panel app and open Opera Mail when there is new mail, here is what to do. Open a text editor like gedit and copy and paste the following:
#!/bin/sh
mail-notification -r
if ps ax | grep -v grep | grep /usr/lib/opera/*/opera > /dev/null
then opera -remote "openM2()"
else opera -mail
fi
Make sure /usr/lib/opera/*/opera corresponds with the actual path on your system. You can probably replace this whole path with simply "opera" and it will work also. Afterwards, save the file somewhere with the ".sh" ending to remind you that it is a script. In a terminal user logged in as root make the script executable with the following command:
chmod filename.sh a+x
Replacing filename with the actual filename obviously. Now set this script as your default mail program in System-Preferences-Personal-Preferred Applications menu under custom command. Ensure to include the path to your script ( eg /home/your_username/shell_scripts/filename.sh ) Set the mail-notification "click-action" to open the default mail program.
Hope this might be useful for someone else too.
Last edited by eoinjones; 01-24-2009 at 03:52 AM.
Reason: missing comma
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.