maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Setting environment variables? (https://talk.maemo.org/showthread.php?t=43834)

techdork 2010-02-09 02:26

Setting environment variables?
 
Can't figure this out.. I need to add a few places in $PATH permanently for osso-xterm and cannot find any references or documentation on how to do this on my N900 / Maemo5.

Please advise

CrashandDie 2010-02-09 04:40

Re: Setting environment variables?
 
If my memory serves me well, you should be able to create a .profile file in your home directory (~/.profile) and add your exports there.

For example:

Code:

echo "export FOO=bar" >> ~/.profile
Or alternatively, edit /etc/profile, however that might be dangerous as that file is used for nearly all -- if not all -- the terminal sessions that run on the device.

techdork 2010-02-09 09:18

Re: Setting environment variables?
 
Quote:

Originally Posted by CrashandDie (Post 517202)
If my memory serves me well, you should be able to create a .profile file in your home directory (~/.profile) and add your exports there.

For example:

Code:

echo "export FOO=bar" >> ~/.profile
Or alternatively, edit /etc/profile, however that might be dangerous as that file is used for nearly all -- if not all -- the terminal sessions that run on the device.

No unfortunately I had tried both and neither work :s

nowave7 2010-02-09 09:49

Re: Setting environment variables?
 
Have you tried putting it to .bashrc in your home directory?
Something like this:

Code:

export PATH=$PATH:/home/user/MyDocs

Rob1n 2010-02-09 09:50

Re: Setting environment variables?
 
Quote:

Originally Posted by techdork (Post 517417)
No unfortunately I had tried both and neither work :s

Setting environment variables in the ~/.profile works fine for me - I modify both the PATH and PERL5LIB variables there.

ginggs 2015-07-28 07:15

Re: Setting environment variables?
 
Quote:

Originally Posted by Rob1n (Post 517449)
Setting environment variables in the ~/.profile works fine for me - I modify both the PATH and PERL5LIB variables there.

Works here too.

Edit: Oops, the following applies to the Nokia N9:

I recently lost ~/.profile due to a corrupt filesystem on /dev/mmcblk0p3.

I found the stock Twitter application did not show any tweets and wrote the following to /var/log/syslog:
Code:

twitter-meego[4859]: CRITICAL-Error: Not found XDG_CACHE_HOME environment variable
The Documents application (office-tools) would list documents, but would not open them. It complained about being unable to write to '/libkok'.

I managed to find a copy of ~/.profile which think is untouched (I don't recall making any changes here):
Code:

export DISPLAY=':0'
export XDG_DATA_HOME="$HOME/.local/share/"
export XDG_CACHE_HOME="$HOME/.cache"

eval `/usr/bin/aegis-session --sh-syntax --with-ulimit`

if [ -e /etc/profile.d/language.sh ] ; then
    . /etc/profile.d/language.sh
fi

After restoring this file (and possibly rebooting), Twitter and Documents started working again.


All times are GMT. The time now is 20:16.

vBulletin® Version 3.8.8