Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I use GNOME and it first executes commands from /etc/profile and then from ~/.profile. This I have found by putting statements like echo 'something' > test in all files that i could think of like .bashrc, .bash_profile, .profile, /etc/profile and others.

What I am curious about is to know if there is any standard file that all Desktop Managers are required to execute commands from? is there any agreement between Desktop Mangers in this regard or do they use which ever file they want.

share|improve this question
    
I changed your question based on your comment. You mean GNOME, not GDM. GNOME is the Desktop Environment (not Desktop Manager) and GDM is the display manager. GDM doesn't care about your individual user settings; GNOME and KDE do. –  RolandiXor Dec 7 '10 at 22:11

1 Answer 1

up vote 5 down vote accepted

If you are trying to get a script to run on login, just add it to your startup programs (system>preferences>startup applications).

Anything you add to this will be read by all 3 of the D.E. For example you could write a script in /home/username/bin, and add this to your start up programs. alt text

share|improve this answer
2  
I am not interested in specific problem but we all have faced situations where we want to do something at login like create/edit an environment variable. In GDM I can simple edit /etc/profile (or ~/.profile if its specific to a user) and add a line to it to create that environment variable. What I want to know is that if there is a file that every Desktop Manger will read, so that if I switch to KDE I dont have to add same line to some other file. –  binW Dec 7 '10 at 16:15
    
+1 for Roland's answer. If it's only a variable or whatever you need to define in a per user setting IMO still the easiest (and btw safest!) way is to add a script to your start-up programs, even if it's single line only. –  Takkat Dec 7 '10 at 16:47
3  
Yep. All freedesktop compliant desktops will check for .desktop files in /etc/xdg/autostart and ~/.config/autostart The start-up programs app simply creates a .desktop file running the provided command. –  andrewsomething Dec 7 '10 at 18:49
    
binW, I don't see why it's not working. ~/.profile IS read by all D.E. so it should be loaded by KDE/GNOME/XFCE. –  RolandiXor Dec 7 '10 at 22:09
    
@Roland binW did not claim that anything was non-functional. He asked a question. Knowing the answer to his single, generalized question spares him the task of otherwise having to test out every miscellaneous desktop environment out there to discover its method of reading startup commands. –  ændrük Dec 8 '10 at 4:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.