@echo off REM Script for using Cygwin's xterm and ssh to connect to Unix from Windows REM Written By David Brown, doc.brown@eds.com 317.230.3623 REM ARGUMENTS %1 %2 %3 %4 %5 REM Setup Cygwin environment... SET DISPLAY=127.0.0.1:0.0 SET CYGWIN_ROOT=C:\cygwin SET PATH=.;%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin;%PATH% SET XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults SET XCMSDB=/usr/X11R6/lib/X11/Xcms.txt SET XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB SET XNLSPATH=/usr/X11R6/lib/X11/locale REM Cleanup after last run... REM if not exist %CYGWIN_ROOT%\tmp\.X11-unix\X0 goto CLEANUP-FINISH REM attrib -s %CYGWIN_ROOT%\tmp\.X11-unix\X0 REM del %CYGWIN_ROOT%\tmp\.X11-unix\X0 REM :CLEANUP-FINISH REM if exist %CYGWIN_ROOT%\tmp\.X11-unix rmdir %CYGWIN_ROOT%\tmp\.X11-unix REM Try to run an XServer, if already running ignore the error... REM You may comment this out if you'd like to start/stop the XServer yourself... run XWin -multiwindow -clipboard -silent-dup-error REM Startup a remote xterm to %1 as user %2 using ssh (fgcolor %3 and bgcolor %4) REM Argument %5 is a flag that if set (to anything) will set ssh to use compression REM To forward X11 traffic through ssh connection you must add lines to ~/.ssh/config: REM Host * REM ForwardX11 yes REM You also need to create a key using ssh-keygen on the local machine and add it to REM the authorized_keys file on the remote host to bypass password prompts REM Setup the inital values for the arguments, and ask for host and user if missing... set host=%1 set user=%2 set fgcolor=%3 set bgcolor=%4 set comp=%5 set default=%USERNAME% :HOST if NOT [%host%]==[] goto USER :AGAIN set /p host=Please enter host: if [%host%]==[] goto AGAIN :USER if NOT [%user%]==[] goto FGCOLOR set /p user=Please enter user [%default%]: if [%user%]==[] set user=%default% :FGCOLOR if NOT [%fgcolor%]==[] goto BGCOLOR set fgcolor=white :BGCOLOR if NOT [%bgcolor%]==[] goto COMP set bgcolor=black :COMP if [%comp%]==[] goto CONNECT set comp=-C :CONNECT REM echo %host% REM echo %user% REM echo %fgcolor% REM echo %bgcolor% REM echo %comp% run xterm -sl 1000 -sb -rightbar -fg %fgcolor% -bg %bgcolor% -title "%host%" -n "%host%" -e "ssh -Y %comp% %host% -l %user%"