On 01.08.11 19:59, cogoman wrote:
> From: Erik Christiansen
> > But if the additional script is used, it can also open mutt in an xterm
> > in the top right corner,
>
>    Maybe you can solve a problem that I have been having.  I have been 
> trying to get an icon on the desktop in Puppy Lucid 5.25 to open up an 
> xterminal with the default directory as something different from the 
> default.

Together, I'm sure we can make it do what you want. IIUC, that is to
start the xterm in a directory other than $HOME. (i.e. '.' is 
/some/other/directory)

The first way which came to mind is to put the following line in
~/.bashrc (or whatever shell personal initialisation file your setup
uses:

alias myterm='pushd ~/Personal/info/ && xterm && popd'

Where /Personal/info/ is the directory I used to test it. The pushd and
popd change directory for the xterm, then restore the old '.' for the
invoking shell. (We don't want the alias to have side-effects there.)

If you're using some shell other than bash, the alias syntax may differ,
but for portability of scripts and examples, bash is well ahead.

N.B. and big caveat!: That works for me, because I also have in .bashrc:

xterm () 
{ 
    colours='-fg yellow -bg darkslategrey -cr red';
    /usr/bin/xterm $colours -sb -rightbar -geometry 100x50+300+10 -bc &
}

That's handy, because it lets you customise your default xterm
appearance. (OK, the -bc may not appeal to all.)

                                   OR

If we wanted to make the alias work without the function, we'd need
something like:

alias myterm='pushd ~/Personal/info/ && /usr/bin/xterm & && popd'

but the shell bitches about syntax, whether we use "&&" or ';' between
commands. To solve the syntax issue, and just use the default
/usr/bin/xterm appearance, without the xterm() shell function, we could
change the alias to a shell function:

myterm () 
{ 
    pushd ~/Personal/info/
    /usr/bin/xterm &
    popd
}

Note: If "/Personal/info/" is changed to "$1", the destination becomes
an input parameter:

$ myterm ~/Personal/info/
$ myterm /some/other/directory

If that doesn't work there, or I've misinterpreted the object, just yell
out.

Erik

-- 
She often gave herself very good advice (though she very seldom followed it).
                                                              - Lewis Carroll


------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to