Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Using Gnome 3 on Fedora 15, where should I put a script that needs to execute once when the user logs in graphically?

share|improve this question
    
FYI, the script I have will mount some network drives that are used for software development. –  Trevor Boyd Smith Sep 17 '11 at 21:48
    
Why doesn't ~/.profile get executed when you do graphical log in? –  Trevor Boyd Smith Sep 17 '11 at 21:49
1  
That depends on your display manager (the program where you type your user name and password, e.g. xdm, gdm, kdm, …) and your session manager (which probably is part of a desktop environment, e.g. Gnome, KDE, Xfce, …), as well as how your distribution configured them. What display manager and desktop environment are you using? –  Gilles Sep 17 '11 at 22:18
    
@Gilles, IMO I already stated "default fedora 15" so that should tell you what display manager. –  Trevor Boyd Smith Sep 17 '11 at 22:41
    
When I do ps -ef | grep gdm I get: root 1117 1 0 15:16 ? 00:00:00 /usr/sbin/gdm-binary -nodaemon root 1142 1117 0 15:16 ? 00:00:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1 root 1156 1142 0 15:16 tty1 00:00:53 /usr/bin/Xorg :0 -background none -verbose -auth /var/run/gdm/auth-for-gdm-8pX5qs/database -nolisten tcp vt1 root 1402 1142 0 15:16 ? 00:00:00 pam: gdm-password (Also echo $DESKTOP_SESSION returns gnome.) Given the output, I think that means default fedora 15 runs gnome display manager. –  Trevor Boyd Smith Sep 17 '11 at 22:42
add comment

2 Answers

up vote 1 down vote accepted

When a user logs into the graphical mode, the predefined desktop environment starts (Gnome 3 in your case). This is the software package that should be used for setting up and configuring anything that is to be started when the user logs in graphically.


First create the script, place it in some private place like ~/scripts/ or ~/bin/ and make executable (chmod +x script_path_and_name.sh). Then, from Gnome System menu select Preferences->Startup Programs. Click Add on the right of the list, type any name you want and point Command to the script you just created.

I was translating all the menu entries back to English from Polish, so please correct me if I made a mistake there. (My girlfriend's computer is the only one around that has Gnome installed :) )

share|improve this answer
    
FYI, I edited the question to show "gnome 3". –  Trevor Boyd Smith Sep 19 '11 at 12:50
add comment

If you're using F15, your profile file is

~/.bash_profile

instead of

~/.profile

So, see if that file exist and edit it adding your script

share|improve this answer
1  
The only shell that reads .bash_profile is bash, and if that file is not present, it reads .profile. –  Gilles Sep 17 '11 at 22:16
1  
also ~/.bash_profile will only execute for shell-login not graphical login. (i didn't downvote tho...) –  Trevor Boyd Smith Sep 17 '11 at 22:23
add comment

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.