This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
using cygpath for setting $HOME in multiuser and multicomputer environment
- From: Stefan Schiebeler <JarJar dot Binks at gmx dot de>
- To: cygwin-xfree at cygwin dot com
- Date: Mon, 24 Mar 2003 16:21:10 +0100 (MET)
- Subject: using cygpath for setting $HOME in multiuser and multicomputer environment
- Reply-to: cygwin-xfree at cygwin dot com
Hi,
since I plan to distribute LyX in my universitiy's department I have to
consider a very inhomogenous computer environment, ranging from PCs with network,
without, from Win9x to XP, with homedirs on servers, to what-ever-you-want.
I want to set $HOME to the value stored in
\HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell
Folders\AppData
my /etc/profile looks this way:
snipp----------------
PATH="/usr/local/bin:/usr/bin:/bin:$PATH"
USER="`id -un`"
# Set up USER's home directory
# if [ -z "$HOME" ]; then
# HOME="/home/$USER"
# fi
APPDATA=`regtool get
"\HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\AppData"`
FOO=`cygpath -ws "$APPDATA"`
HOME=`cygpath -u "$FOO"`
if [ ! -d "$HOME" ]; then
mkdir -p "$HOME"
fi
export HOME USER
for i in /etc/profile.d/*.sh ; do
if [ -f $i ]; then
. $i
fi
done
export MAKE_MODE=unix
export PS1='\[\033]0;\w\007
\033[32m\]\u at \h \[\033[33m\w\033[0m\]
$ '
cd "$HOME"
snapp----------------
starting bash (cygwin.bat) with user Admin on SCHIEBELER1 cygwin sets $HOME
correctly to
/cygdrive/f/DOKUME~1/ADMIN~1.SCH/ANWEND~1
To tart LyX I used the provided startlyx.bat
snipp----------------
@echo off
SET DISPLAY=127.0.0.1:0.0
SET CYGWIN_ROOT=E:\Programme\office\cygwin
SET PATH=.;%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin;%PATH%
if not exist %CYGWIN_ROOT%\tmp\.X11-unix\X0 goto CLEANUP-FINISH
attrib -s %CYGWIN_ROOT%\tmp\.X11-unix\X0
del %CYGWIN_ROOT%\tmp\.X11-unix\X0
:CLEANUP-FINISH
if exist %CYGWIN_ROOT%\tmp\.X11-unix rmdir %CYGWIN_ROOT%\tmp\.X11-unix
if "%OS%" == "Windows_NT" goto USE-B-SWITCH
echo startxwin.bat - Starting on Windows 95/98/Me
start XWin
run xterm -sl 1000 -sb -rightbar -ms red -fg yellow -bg black -e
/usr/bin/bash
run twm
goto END
:USE-B-SWITCH
echo startlyx.bat - Starting LyX on Windows NT/2000
start XWin -screen 0 1250 940
run twm
run lyxwin32.exe -geometry 1250x900+0+0 %1 %2 %3 %4 %5
:END
run xsetroot -solid aquamarine4
snapp----------------
if I do so unfortunately nothing appears except an empty anquamarine-colored
Cygwin/Xfree86 rl window.
if I click and start an xterm, HOME is set to /home/Admin (which doesn't
exist) and ps shows a cygpath process. After killing that process there is one
bash process more than before and another cygpath process running - killing
that LyX starts but without a proper set $HOME.
Can enyone point me to my mistake?
regards
Stefan
--
+++ GMX - Mail, Messaging & more http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!