Re: automatic change default working directory after graphical login



geda.mail@xxxxxxxxx wrote:
On May 3, 6:46 pm, Nico Kadel-Garcia <nka...@xxxxxxxxx> wrote:
geda.m...@xxxxxxxxx wrote:
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]
A) oo: no, putting 'cd /proj/$USER' into .cshrc is _not_ the solution
B) 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)
OK, *WHY*????


Is your "WHY???" related to A) or to B) ???

No, it's related to the first paragraph, wanting to change the operating directory of an X startup to the /proj/$USER.

$CWD, or 'current working directory', is associated with the current-working-directory fo the X sesseion when it starts. This state will be associated with anything else started in that window, but it's not clear to me why you want to do this. It won't change your $HOME, or where your configuration files are kept, etc. So why do you want to do this?

If it is related to A, the explanation is simple:
because the following script will ___not___ work correctly
-------------------------------
#!/bin/tcsh

echo "Hello World" > test_file

exit
--------------------------------

Let suppose, the user will launch the scrip from /aaa/bbb/cccc. The
sript will NOT create the test_file in the current working directory.
The file will be created in /proj/$USER, which does not make sense...
it is not intuitive.

Yes, I know, #!/bin/tcsh -f can solve the problem. My users wrote a
lot of scripts already without a switch -f so, most of them will not
work correctly anymore

If the 'WHY???' is related to B) then I do not know the answer. I
do not know why is .login NOT executed if the $USER login into the
machine via gdm.

Oooff. The vagaries of what .files get executed is a black art. I believe this one has to do with gdm starting up a shell, not a login session, to preserve the various environmental settings of the X session.

SOLUTION:
click on this link:
http://mail.gnome.org/archives/gdm-list/2008-May/msg00008.html
or/and
http://mail.gnome.org/archives/gdm-list/2008-May/msg00006.html
or/and
http://mail.gnome.org/archives/gdm-list/2008-May/msg00007.html
.



Relevant Pages

  • Re: automatic change default working directory after graphical login
    ... 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 login (aka gdm). ...
    (linux.redhat.misc)
  • Re: automatic change default working directory after graphical login
    ... 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 login (aka gdm). ...
    (linux.redhat.misc)
  • Re: Web login problem
    ... Thanks Timo, the problem is that most of the time i do not want the page to ... do anything within the application, but when in the login page ... When user logs out the cookie is disposed. ... Setting this value to zero reloads page every time. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: User Authentication and password protection of several files
    ... I need a login page where user inputs a password and an email address. ... User clicks on one of the l inks in mainpage.php and watches a video ... All pages in this setup a) need to be protected, ... When the user logs in, set a value in the $_SESSION array. ...
    (comp.lang.php)
  • Security Access for external users
    ... a user logs in for the first time that day thru ... last login instead of the latest actual login. ... Integrated Windows authentication. ...
    (microsoft.public.inetserver.iis.security)