Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Set environment variables for GUI app?

Set environment variables for GUI app?
Thread Tools
Fresh-Faced Recruit
Join Date: Oct 2003
Status: Offline
Reply With Quote
Nov 15, 2003, 10:31 AM
 
Anyone know of a way to set the environment variable of an application launched out of the finder or dock?

I try to set them in .tcshrc or .login or .profile, but that only seems to affect shells inside Terminal or xterms.

I know on linux, I can set variables in .xsession or in .gnome/session. Is there an analagous system for setting session-level environment variables in the Mac UI?

-- alan
     
Mac Elite
Join Date: Mar 2001
Location: Provo, UT
Status: Offline
Reply With Quote
Nov 15, 2003, 01:10 PM
 
Most native OSX applications don't use environment variables. Their settings are stored in plists typically in your preference directory (~/Library/preferences).

The only native OSX apps that use environment variables are ones that interact with traditional Unix software like mySQL.
     
Fresh-Faced Recruit
Join Date: Sep 2002
Location: Sydney, Australia
Status: Offline
Reply With Quote
Nov 16, 2003, 05:30 AM
 
you can make an environment.plist file and put it in a directory called .MacOSX in your home directory. a quick search at apple developer came up with technical Q&A

there is more info there, and in the discussions at apple.

cheers
     
Fresh-Faced Recruit
Join Date: Oct 2003
Status: Offline
Reply With Quote
Nov 18, 2003, 07:10 PM
 
Sam, thanks for the info. It looks like that will do exactly what I want. :-)

-- alan

P.S., the app that I am trying to pass the environment variable is the OSX port of GNU Emacs, which derives certain aspects of its config from environment variables, even though that isn't the way most native OSX apps behave.
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:45 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2