LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 05-03-2008, 06:01 PM   #1
primorec
Member
 
Registered: Sep 2004
Distribution: RH5.2/6.2/8.0/9.0,RHEL 3.0/4.X/5.X/6.X,MDK 10.1,KNOPPIX3.6,Solaris 8/9,CentOS 3.X/4.X/5.X/6.X/7.X
Posts: 67

Rep: Reputation: 15
automatic change default working directory after graphical login


short description of the problem:
I would like to automagically change the working directory from $HOME to, for example, /proj/$USER after the $USER logs into the machine via the graphical (GUI) login (aka gdm). So, when the $USER opens new terminal, he/she should be in /proj/$USER and __not__ in $HOME
[side note: I am using tsch as my $SHELL]

oo: no, putting 'cd /proj/$USER' into .cshrc is _not_ the solution

oo: yes, putting 'cd /proj/$USER' into .login works if the user logs into the machine using CLI login and then starts the desktop with 'startx' OR if he/she logs to the machine via ssh|telnet. It does not work for gdm (aka graphical login)

oo: no, adding 'cd /proj/$USER' to the file Default or Xsession does __not__ work.

/etc/gdm/PostLogin/Default
/etc/gdm/PreSession/Default
/etc/gdm/Xsession

oo: yes, I did read all relevant posts in 'Click Here to Find Similar Threads'.

oo: no, I do not want to change variable $HOME to point to /proj/$USER

oo: no, I do not want to modify /etc/passwd file

Simply put, I am out of ideas. Any hint, RTFM pointer or solution is appreciated.

Igor
 
Old 05-03-2008, 08:33 PM   #2
anon099
Member
 
Registered: Oct 2002
Posts: 188

Rep: Reputation: Disabled
Hate to say it but changing the $HOME variable is the only thing I would think could do that. The only other guess if I were using bash would be to add this to the bashrc file of the user if you were using gnome-terminal

alias gnome-terminal='gnome-terminal --working-directory=/proj/$USER'

or a different alias for xterm or other terminals.

I've never really used tcsh but i figure you can translate such things.

Not the best answer but hopefully it will help somewhat.
 
Old 05-03-2008, 09:12 PM   #3
primorec
Member
 
Registered: Sep 2004
Distribution: RH5.2/6.2/8.0/9.0,RHEL 3.0/4.X/5.X/6.X,MDK 10.1,KNOPPIX3.6,Solaris 8/9,CentOS 3.X/4.X/5.X/6.X/7.X
Posts: 67

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by padlamoij View Post
Hate to say it but changing the $HOME variable is the only thing I would think could do that. The only other guess if I were using bash would be to add this to the bashrc file of the user if you were using gnome-terminal

alias gnome-terminal='gnome-terminal --working-directory=/proj/$USER'

or a different alias for xterm or other terminals.

I've never really used tcsh but i figure you can translate such things.

Not the best answer but hopefully it will help somewhat.

Thanks for the reply. I will try the suggested trick. I have to try it under different conditions... for example... launching gnome-terminal from another script, from xterm, as a shell from gnuplot, from calc, from octave, via ssh, from remothe machine.. etc etc.

It has to be robust because I do not have time and motivation to babysit all the LAB users ( 40 lab workstation and 100+ users).
We will see how it goes.

Yes I can translate your hint to tcsh. No problem. Thanks
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
change default vsftp anonymous accout directory /var/ftp to other directory? hocheetiong Linux - Newbie 2 01-24-2010 06:33 PM
automatic change default working directory after graphical login primorec Linux - Newbie 2 05-05-2008 04:13 PM
Automatic Graphical Login for Slackware. duffmckagan Slackware 20 06-08-2005 07:33 AM
Replacing default graphical login screen with downloaded one coolamit78 Linux - Software 2 10-16-2003 12:39 PM
change graphical login in Gnome nhasbek Linux - Newbie 1 12-12-2002 06:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 01:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration