[NCLUG] Ubuntu 8.04 - CLI mode

Bob Proulx bob at proulx.com
Thu Aug 7 18:52:16 MDT 2008


William Greger wrote:
> When I have been working the IC design workplace,

Ah...  As one of the people who supported IC CAD tools for a number of
years, very well I know several of the local design environments. :-)

> the IT group has already set up my account and initial design
> environment, which is command line interface.  Then, when I login,
> the PC reads my .login file (see attached).

BTW...  Nothing was attached.  But I don't think that is important.

> The design tools are more amenable (to me) in a command line mode,
> and it lends itself better to scripting.

I think you will find that a large number of the GNU/Unix crowd around
here are dedicated keyboard users.  The mouse is highly overrated! :-)

> So I am trying to emulate the same scenario.  For me to set up my
> terminal windows, I have to use Applications -> Accessories ->
> Terminal, and then source ~/.login.  After which I remove the
> original terminal window.

This tells me several things.  One is that you mention .login which is
a csh/tcsh profile.  Blech!  (Spits on the ground.)  Terrible shell.
Terrible shell scripting language.  I won't hide my opinion about it.
The Bourne shell is much better and today the POSIX shell for shell
scripting is the way to go.  Any of bash, ksh, zsh are better choices.

You don't say but I am wondering if you are doing this simply to load
up a new [t]csh?  I assume that you have changed your login shell to
tcsh and the root cause of the problem is that it is not loading the
$HOME/.login file by default for you?  Is that a good guess?

In any case the .login/.profile is not sourced by default because
terminal windows do not start login shells by default.

> Applications -> Accessories -> Terminal

In addition to the suggestions of others you can simplify things by
dragging that to the taskbar.  That will place an icon on the taskbar
that is now accessible with one mouse click instead of needing
several.  Open the menu the same as you have been doing but then
instead of clicking on the Terminal entry drag it over to the taskbar
to wherever you want it.  That will create a shortcut to it.

Then you can right click on the shortcut and open the properties and
edit the laucher to change it to be any customization that you want.
I desire Xterms and therefore I change the command from
"gnome-terminal" over to "xterm".  (I also change the icon to be an
Xterm icon but just so I know what I am getting.)  Additionally you
can make that "xterm -ls" and the xterm will start the shell with a
leading "-" (e.g. "-bash" or "-csh") such that it will know that it
should be a login shell and will load the login environment files.
For many people that is a reasonable solution.

However I don't like to load every shell as a login shell.  Instead I
make sure that the bottom shell in my X session starts as a login
shell and my .profile is then loaded from there.  This is discussed
often because GNOME and KDE both specifically avoid doing this for you
by default.  (Red Hat fixes this best of the distros I have examined.)
In order to get this on Debian/Ubuntu I add a $HOME/.xsession file
with the following contents and make it executable.  Note: This file
MUST BE EXECUTABLE or it won't have the right behavior.

  #!/bin/bash --login
  exec x-session-manager
  #exec fvwm2
  #exec startkde
  #exec gnome-session

The "x-session-manager" is a system 'alternative' that will point to
whichever is the default system window session manager.  This allows
the system to switch from GNOME to KDE and everything can work
transparently.  But you can pick your own choice if you desire.

So this response is simply because I am guessing that you want your
$HOME/.login file to be sourced and it is not getting sourced by
default when you log in and therefore you are wanting to disable the
gdm/kdm/xdm X display manager such that you really log in for real the
first time and then start X on top of this.  But doing one of the
above things will cause it to load your environment even while using
the graphical login manager and so that might be the better solution
for you.  I am curious if I have guessed right...

Bob



More information about the NCLUG mailing list