This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Bash Window Geometry


Corinna wrote:
> On Feb  6 17:34, Bubba Jones wrote:
>> On Mon, 6 Feb 2006 12:13:43 -0500 (EST) Igor Peshansky
> <pechtcha@**.***.***> wrote:
>>> On Mon, 6 Feb 2006, Bubba Jones wrote:
>>>
>>>> Is it possible to tell the bash prompt where I want it positioned
>>>> on my desktop?  Using X Windows I specify size and location with
>>>> "--geometry". Is there anything comparable under MS Windows?
>>>
>>> First off, <http://cygwin.com/acronyms/#PCYMTWLL>.  Thanks.
>>
>> I think my mailer might be goofed...  I don't see an option
>> for that.  I'll fix it the ole fashioned way though with a manual
>> CR/LF :) .
>>
>>> Now, if you're starting bash from a shortcut (e.g., the one Cygwin
>>> installation puts on your desktop), you can change shortcut
>>> parameters to put the window anywhere you want
>>> (Properties->Layout->Window position).
>>
>> Thanks, but I'm looking for something like the "--geometry"
>> feature of X.
>
> If you use rxvt instead of the standard console window, then just try
> the -geometry option...
>
>
> Corinna

 Note that if you have a correctly defined $HOME at the time when you start
rxvt, then you can use the $HOME/.Xdefaults file to define the geometry and
more
(see man rxvt)

e.g. running something that mimics this; (UNTESTED!)

	bash <<EOF
	HOME="/home/$(id -un)"
	export HOME
	. /etc/profile  # necessary?
	rxvt -ls /bin/bash -li &
	EOF

from cygwin.bat will have you up and running, with settings from .Xdefaults
in your (default) home dir (as setup by /etc/profile).

NOTE: it is necessary to do tricks to accomplish the above,
       as .bat/cmd.exe doesn't allow "here docs".

I have something similar setup on my work machine, but I don't remember how
it is exactly - @home now.
 Another optional "path" is to have $HOME be the null string (from
Windows/cygwin.bat) and have /etc/profile pathed as indicated below.

/H

$ diff -u /etc/defaults/etc/profile{.old,}
--- /etc/defaults/etc/profile.old       2006-02-03 10:14:15.947837500 +0100
+++ /etc/defaults/etc/profile   2006-02-03 10:17:57.977674300 +0100
@@ -42,11 +42,16 @@
 export USER

 # Here is how HOME is set, in order of priority, when starting from Windows
+#  0) /home/$USER if $HOME is null
 #  1) From existing HOME in the Windows environment, translated to a Posix
path
 #  2) from /etc/passwd, if there is an entry with a non empty directory
field
 #  3) from HOMEDRIVE/HOMEPATH
 #  4) / (root)

+if [ -z "$HOME" ]; then
+  HOME=/home/$USER
+fi
+
 # If the home directory doesn't exist, create it.
 if [ ! -d "${HOME}" ]; then
        mkdir -p "${HOME}"

--


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]