Jerry's Study分享 http://blog.sciencenet.cn/u/jerry916 It matters if you just don't give up.

博文

Cygwin脚本修改

已有 6462 次阅读 2010-4-25 22:59 |个人分类:Research|系统分类:科研笔记|关键词:学者| Cygwin

@echo off
set CYGWIN= title ntea
D:
chdir D:cygwinbin
for /f %%i in ('tasklist') do if /i %%i==XWin.exe (taskkill /IM XWin.exe /F)
call d:cygwinbinstartxwin.bat
bash --login -i

第二行显示当前命令状态
第五行检测xserver的进程是否存在,若存在,则结束该进程
第六行调用startxwin.bat脚本

另外备注一下:
set CYGWIN=binmode tty ntsec
用于防止在shell中打开的无窗口的emacs无法退出



附startxwin.bat文件:

@echo off
SET DISPLAY=127.0.0.1:0.0


REM
REM The path in the CYGWIN_ROOT environment variable assignment assume
REM that Cygwin is installed in a directory called 'cygwin' in the root
REM directory of the current drive.  You will only need to modify
REM CYGWIN_ROOT if you have installed Cygwin in another directory.  For
REM example, if you installed Cygwin in foobarbazcygwin, you will need
REM to change cygwin to foobarbazcygwin.
REM
REM This batch file will almost always be run from the same drive (and
REM directory) as the drive that contains Cygwin/X, therefore you will
REM not need to add a drive letter to CYGWIN_ROOT.  For example, you do
REM not need to change cygwin to c:cygwin if you are running this
REM batch file from the C drive.
REM

SET CYGWIN_ROOT=cygwin
SET RUN=%CYGWIN_ROOT%binrun -p /usr/bin

SET PATH=.;%CYGWIN_ROOT%bin;%PATH%

SET XAPPLRESDIR=
SET XCMSDB=
SET XKEYSYMDB=
SET XNLSPATH=


REM
REM Cleanup after last run.
REM

if not exist %CYGWIN_ROOT%tmp.X11-unixX0 goto CLEANUP-FINISH
attrib -s %CYGWIN_ROOT%tmp.X11-unixX0
del %CYGWIN_ROOT%tmp.X11-unixX0

:CLEANUP-FINISH
if exist %CYGWIN_ROOT%tmp.X11-unix rmdir %CYGWIN_ROOT%tmp.X11-unix


REM
REM The error "Fatal server error: could not open default font 'fixed'" is
REM caused by using a DOS mode mount for the mount that the Cygwin/X
REM fonts are accessed through.  See the Cygwin/X FAQ for more
REM information:
REM http://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-error-font-eof
REM

if "%OS%" == "Windows_NT" goto OS_NT

REM Windows 95/98/Me
echo startxwin.bat - Starting on Windows 95/98/Me

goto STARTUP

:OS_NT

REM Windows NT/2000/XP/2003
echo startxwin.bat - Starting on Windows NT/2000/XP/2003

:STARTUP

REM Description of XWin-specific options is in XWin(1) manpage.


REM
REM Startup the programs
REM


REM Startup the X Server with the integrated Windows-based window manager.
REM WARNING: Do not use 'xwinclip' in conjunction with the ``-clipboard''
REM command-line parameter for XWin.  Doing so would start two clipboard
REM managers, which is never supposed to happen.

%RUN% XWin -multiwindow -clipboard -silent-dup-error


REM Startup an xterm, using bash as the shell.

%RUN% xterm -e /usr/bin/bash -l


REM
REM Startup the twm window manager.
REM WARNING: Do not use an external window manager in conjunction with
REM the ``-multiwindow'' command-line parameter for XWin.  Doing so
REM would start two window managers, which is never supposed to happen.
REM

REM %RUN% twm


REM Set a background color.  Only needed when not using -multwindow for XWin.

REM %RUN% xsetroot -solid aquamarine4

https://m.sciencenet.cn/blog-437437-316063.html

上一篇:TeX Live 2009笔记(1)——入门介绍
下一篇:信息与通信工程——重要国际学术会议

0

发表评论 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-19 17:28

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部