Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Main Support Categories > Desktop Environments
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.

Desktop Environments
Support for your Ubuntu desktop. Including Gnome, KDE and XFCE.

 
Thread Tools Display Modes
Old February 4th, 2008   #1
kornelix
A Carafe of Ubuntu
 
Join Date: Jan 2006
Location: Germany
Beans: 120
Ubuntu 9.10 Karmic Koala
Question .gnomerc does not run

I want to define some environment variables that are available for applications started from a gnome desktop launcher. Following suggestions found in this forum, I put the definitions in ~./gnomerc. They are ignored. I also made it executable and included the #!/bin/bash header, but that made no difference. The same export statements in ~./bashrc work fine, but only for terminal sessions. I also tried .gtkrc and .gtkrc-2.0 (as suggested in another message) but this was no different. None of them work. I did log out/in for each trial.

Help.
kornelix is offline   Reply With Quote
Old February 4th, 2008   #2
ayoli
Fresh Brewed Ubuntu
 
ayoli's Avatar
 
Join Date: Jun 2006
Location: Millau, France
Beans: 1,477
Ubuntu 9.10 Karmic Koala
Send a message via Yahoo to ayoli
Re: .gnomerc does not run

Quote:
Originally Posted by kornelix View Post
I want to define some environment variables that are available for applications started from a gnome desktop launcher. Following suggestions found in this forum, I put the definitions in ~./gnomerc. They are ignored. I also made it executable and included the #!/bin/bash header, but that made no difference. The same export statements in ~./bashrc work fine, but only for terminal sessions. I also tried .gtkrc and .gtkrc-2.0 (as suggested in another message) but this was no different. None of them work. I did log out/in for each trial.

Help.
The exact file name is
Code:
~/.gnomerc
(do not forget the leading dot, it's a hidden file)
then you can export variable like this
Code:
export VAR_NAME=value;
export VAR_NAME="string"
no spaces between variable name and the equal sign
no $ before the var name.
I don't think the file need to be executable, simple read access for all should be enough.
You have to logout/login gnome each time you change something in this file and want to see the changes.
__________________
my blog - linux user #423778 - Ubuntu user #4214
HP nc6400 Core duo 1,66GHz Ram 3Go GChip i945GM HD 250Go@7200rpm
Get a dynamic blogroll - Install gnome globalmenu
ayoli is online now   Reply With Quote
Old February 4th, 2008   #3
kornelix
A Carafe of Ubuntu
 
Join Date: Jan 2006
Location: Germany
Beans: 120
Ubuntu 9.10 Karmic Koala
Re: .gnomerc does not run

Thanks, but I am already doing exactly what you specified.

~./gnomerc is in the same directory as ~./bashrc and the export statements are the same. .bashrc works and .gnomerc does not (apps started from desktop launchers see the variables as undefined).

I cannot rule out some stupid mistake but I have looked and looked...
kornelix is offline   Reply With Quote
Old February 4th, 2008   #4
ayoli
Fresh Brewed Ubuntu
 
ayoli's Avatar
 
Join Date: Jun 2006
Location: Millau, France
Beans: 1,477
Ubuntu 9.10 Karmic Koala
Send a message via Yahoo to ayoli
Re: .gnomerc does not run

Quote:
Originally Posted by kornelix View Post
Thanks, but I am already doing exactly what you specified.

~./gnomerc is in the same directory as ~./bashrc and the export statements are the same. .bashrc works and .gnomerc does not (apps started from desktop launchers see the variables as undefined).

I cannot rule out some stupid mistake but I have looked and looked...
paste the output of:
Code:
ls ~/.gnomerc && cat ~/.gnomerc
and are you running a gnome session or do you another environment (xfce, ...) ?
__________________
my blog - linux user #423778 - Ubuntu user #4214
HP nc6400 Core duo 1,66GHz Ram 3Go GChip i945GM HD 250Go@7200rpm
Get a dynamic blogroll - Install gnome globalmenu
ayoli is online now   Reply With Quote
Old February 4th, 2008   #5
kornelix
A Carafe of Ubuntu
 
Join Date: Jan 2006
Location: Germany
Beans: 120
Ubuntu 9.10 Karmic Koala
Re: .gnomerc does not run

Code:
~ $: ls ~/.gnomerc
/home/mico/.gnomerc
~ $: cat ~/.gnomerc
#!/bin/bash
export HISTFILESIZE=10000
export HISTSIZE=10000
export MALLOC_CHECK=2
export programs="/home2/mico/programs"
alias beroot="/home/mico/beroot/beroot"
alias lang="/home2/mico/programs/shell/setlocale"
I have figured out that the above export statements are indeed being executed. It is the alias statements that are not taking. If I try using the command 'beroot' in a launcher, I get "command not found". If I use it in a terminal it works as expected (since .bashrc has the same definitions).

So the real question is: why no alias command in a launcher?
Or, is there a way?

thanks
kornelix is offline   Reply With Quote
Old February 4th, 2008   #6
ayoli
Fresh Brewed Ubuntu
 
ayoli's Avatar
 
Join Date: Jun 2006
Location: Millau, France
Beans: 1,477
Ubuntu 9.10 Karmic Koala
Send a message via Yahoo to ayoli
Re: .gnomerc does not run

Quote:
Originally Posted by kornelix View Post
Code:
~ $: ls ~/.gnomerc
/home/mico/.gnomerc
~ $: cat ~/.gnomerc
#!/bin/bash
export HISTFILESIZE=10000
export HISTSIZE=10000
export MALLOC_CHECK=2
export programs="/home2/mico/programs"
alias beroot="/home/mico/beroot/beroot"
alias lang="/home2/mico/programs/shell/setlocale"
I have figured out that the above export statements are indeed being executed. It is the alias statements that are not taking. If I try using the command 'beroot' in a launcher, I get "command not found". If I use it in a terminal it works as expected (since .bashrc has the same definitions).

So the real question is: why no alias command in a launcher?
Or, is there a way?

thanks
Why not just make a link to /usr/local/bin like taht :
Code:
sudo ln -sf /home/mico/beroot/beroot /usr/local/bin
__________________
my blog - linux user #423778 - Ubuntu user #4214
HP nc6400 Core duo 1,66GHz Ram 3Go GChip i945GM HD 250Go@7200rpm
Get a dynamic blogroll - Install gnome globalmenu
ayoli is online now   Reply With Quote
Old February 5th, 2008   #7
kornelix
A Carafe of Ubuntu
 
Join Date: Jan 2006
Location: Germany
Beans: 120
Ubuntu 9.10 Karmic Koala
Re: .gnomerc does not run

Thanks Ayoli for your help. Your last post sent me on a wild ride. I tried a variation of your suggestion:
+ I created a directory ~/bin and put my program beroot there
+ I set PATH in ~/.gnomerc: export PATH=$PATH:~/bin
+ I made a desktop launcher with beroot as the command

After logging out and back in, my desktop was locked up and no launchers appeared on the desktop. I bailed out with ctrl-alt-backspace and logged into my escape hatch root account. I cycled in and out again to be sure of the problem. Rebooted, no help. Then from root I deleted .gnomerc, which was no help. Then I deleted some files where gnome saves states and sessions. That fixed the problem and my gnome desktop came back. There was a huge nautilus log file, from the common problem of nautilus looping and writing debug messages (this comes and goes ever since 7.10, and I am astounded it has not been fixed by now). Note that I never ran beroot or any other non-gnome program. This adventure came solely from gnome.

So I am giving up on this project. I have again been given a lesson that I have been given many times already: don't be adventurous and do uncommon things, because you will run into untested code and trash your system.
kornelix is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:24 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry