Running aterm (or any other X app) rootless, without a DOS console on Cygwin
This guide is outdated. Please check out the updated version of this guide here.
On any system that I plan to use for an extended period of time, I will always install Cygwin. This is mainly because I like have UNIX tools on Windows, and also so that I can use the console to do things that DOS is not able to do. I started using Cygwin in 2000, and I’ve continued using it since. One of the cool things you can do with Cygwin is run X, which means that you can have X applications running on the Windows desktop. When I was interning at Motorola, I used to run eXceed, with fvwm. This was where I first ran into aterm. What I liked most about aterm is the eye-candy. You can have transparent windows with shading effects and all sorts of other cool stuff. I tried to get aterm running on my machine at home by compiling it from source under Cygwin. I was eventually able to do this (install libjpeg, libpng, libAfterImage, zlib, and the X includes and libraries first), but what I didn’t like was the fact that you had to start up a Cygwin console to open up X, and then aterm. I wanted aterm to start up and run directly without that ugly DOS/Cygwin console window. Of course, you can’t simply run the aterm executable because it needs X and Cygwin to be running. I eventually figured it out (actually a few months before leaving on my “extended vacation”) by starting out with X running with a rootless window. Oh, and run.exe proved to be very helpful. Anyway, here is how you do it:
First you need to add C:\cygwin\bin to your PATH Environment Variable. You can do this from My Computer > Properties > Advanced > Environment Variables. You might also have to add C:\cygwin\usr\X11R6\bin to PATH.
Then you need to create two batch files. The first one is to start X, and the second one is to start aterm (or whatever X app you want to start). The example I’m going to show includes starting up X with a wallpaper (using xv), and then running aterm. I run aterm with a transparent background, using the X wallpaper. However, you can also load aterm with a background image of your choice.
The batch file to start X, which I call xwin.bat looks like this:
C:\cygwin\usr\X11R6\bin\run.exe C:\cygwin\usr\X11R6\bin\xwin.exe -multiwindow -clipboard -silent-dup-error C:\cygwin\usr\X11R6\bin\run.exe C:\cygwin\usr\local\bin\xv.exe -display :0 -root -quit -be -maxpect /cygdrive/c/Wallpapers/upper_limit_wp_dark_1600.jpg
This will start up X in a rootless window with upper_limit_wp_dark_1600.jpg as your X wallpaper. Next, you write a batch file (aterm.bat) that will load aterm:
C:\cygwin\usr\X11R6\bin\run.exe C:\cygwin\bin\bash.exe --login -i -c "aterm -sh 50 -tr -trsb -fade 20 -tint gray -bl -sb -st -sr -sl 1000 -tn xterm"
This batch file will load aterm with the background image at 50% brightness, transparent background, transparent scrollbar, 20% fading on losing focus, gray tint, borderless window (sometimes works), scrollbar, trough-less scrollbar, scrollbar on the right, 1000 scrollback lines, and with xterm terminal emulation. One issue I have had with this, is that aterm may load up with the default (checkered) X background. This is because the xv did not properly execute in xwin.bat. I have no idea why this happens, sometimes it works, and sometimes it doesn’t. If it doesn’t, you can modify aterm.bat:
C:\cygwin\usr\X11R6\bin\run.exe C:\cygwin\bin\bash.exe --login -i -c "xv -display :0 -root -quit -be -max /cygdrive/c/Wallpapers/upper_limit_wp_dark_1600.jpg && aterm -sh 50 -tr -trsb -fade 20 -tint gray -bl -sb -st -sr -sl 1000 -tn xterm"
This batch file will load xv every time you start aterm, so there is a slight performance hit on startup. However, it’s not that big of a deal because the xv instance quits right after it sets up the wallpaper, and so you’re not loading a new instance of xv into the memory every time.
Well, there you have it. I hope it was helpful!

Screenshot of my XP desktop, with aterm, xcalc, xclock, xeyes, and xterm running
Popularity: 18% [?]
March 27, 2007 - Posted by vivin | Computers, Cygwin, Operating Systems, Software, Windows | aterm, console, cygwin, terminal, unix, windows xp, x
10 Comments »
Leave a Comment Cancel reply
Search
Blogroll
Links
Popular Posts
Recent Tweets
- wtf wikipedia! #SOPA #PIPA 2 weeks ago
- Twitter realtime search for "WTF wikipedia" is awesome! 2 weeks ago
- Tell Congress: Don’t censor the web! http://t.co/RsVWLQLT 2 weeks ago
- Woh- the internet is rising up to #StopSOPA #PIPA and #InternetCensorship Write Congress today: http://t.co/s7nVNpsP via @fightfortheftr 2 weeks ago
- More updates...
Powered by Twitter Tools
Recent Comments
- vivin: @RDavS: Thank you for that wonderful response. Yes, sometimes I think it is a cynical view, but in the end...
- RDavS: I lean toward the conservative side, but agree completely that nothing valuable is accomplished by fanatic...
- vivin: @Dan: @Roland: Glad that you guys found the tutorial helpful!
- Roland: Your tutorial is easy to follow and helped me a lot in implementing a nice zoom-and-drag-feature for my...
- Jamie: Thanks for the tip , I was looking for a way to set up the image side by side ,you have save me a lot of time
Recent Trackbacks
- Producing Emerging Media: Color Correcting and Photos in Wordpress
- Rough Book: Maven project for Generic (n-ary) Tree in Java
- Page 2 - Sprint Android Forum: Does Anyone Have a Shapewriter apk?
- JavaFX: LIS 7440
- Week 8: LIS 7440
Random Posts
Tag Cloud
ait army army national guard asperger's syndrome asu baghdad camp liberty code cse421 dancing development dsl family fort lee freebsd garba hhb 1/180th inane india indian school al-ghubra iraq isg java Life linux message board my website national guard networking oif oman operation iraqi freedom perl photo album photos pictures programming project roughnecks salsa school vacation war weekend windows xpCategory Cloud
AIT Army Arts Assembly Computers Copyrights Dance Family and Friends FreeBSD Gaming Haiku Hardware Hosting Humor Java Jython Life Linux Love and Marriage Military Movies Music Musings, Ramblings, and Inanities Nerdy Stuff Networking Operating Systems Operation Iraqi Freedom p2p Perl PHP Poetry Politics and Law Programming and Development Projects Prose Python School Sci-Fi Science Software Television Travel Web Windows Work
Meta
Categories
- ►Arts (118)
- ►Art (2)
- ►Books (1)
- ►Concerts (1)
- ►Dance (15)
- ►Movies (6)
- ►Music (40)
- ►Bands (16)
- ►Coldplay (1)
- ►Metallica (3)
- ►Muse (1)
- ►Pink Floyd (1)
- ►Sigur Rös (1)
- ►The Beatles (1)
- ►The Shins (1)
- ►The Strokes (1)
- ►U2 (2)
- ►Coldplay (1)
- ►Genres (10)
- ►Indie (2)
- ►Rock (6)
- ►Alternative (2)
- ►Classic (1)
- ►Psychedelic (1)
- ►Alternative (2)
- ►Indie (2)
- ►Bands (16)
- ►Photography (3)
- ►Poetry (9)
- ►Haiku (4)
- ►Haiku (4)
- ►Prose (5)
- ►Television (5)
- ►Art (2)
- ►Economics (2)
- ►History (1)
- ►Life (537)
- ►Family and Friends (75)
- ►Humor (5)
- ►Love and Marriage (25)
- ►Musings, Ramblings, and Inanities (88)
- ►School (74)
- ►Travel (17)
- ►Work (23)
- ►Family and Friends (75)
- ►Military (198)
- ►Army (126)
- ►AIT (27)
- ►Annual Training (2)
- ►Basic Training (2)
- ►Operation Iraqi Freedom (24)
- ►AIT (27)
- ►Army (126)
- ►Nerdy Stuff (626)
- ►Computers (758)
- ►Hardware (22)
- ►Networking (41)
- ►Operating Systems (109)
- ►Programming and Development (301)
- ►Software (8)
- ►Hardware (22)
- ►DIY (1)
- ►Gaming (13)
- ►Linguistics (3)
- ►Math (1)
- ►Sci-Fi (10)
- ►Science (11)
- ►Technology (3)
- ►Technology (3)
- ►Computers (758)
- ►Politics and Law (39)
- ►Copyrights (10)
- ►DMCA (1)
- ►DMCA (1)
- ►Patents (1)
- ►Copyrights (10)
- ►Arts (118)
Archives
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- July 2011
- June 2011
- May 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- August 2008
- March 2008
- February 2008
- November 2007
- July 2007
- June 2007
- May 2007
- March 2007
- December 2006
- October 2006
- September 2006
- August 2006
- June 2006
- April 2006
- March 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- May 2005
- April 2005
- February 2005
- October 2004
- September 2004
- August 2004
- July 2004
- June 2004
- May 2004
- April 2004
- March 2004
- February 2004
- January 2004
- December 2003
- November 2003
- October 2003
- September 2003
- July 2003
- June 2003
- May 2003
- March 2003
- February 2003
- January 2003
- December 2002
- November 2002
- October 2002
- September 2002
- August 2002
- July 2002
- June 2002
- May 2002
- April 2002
- February 2002
- September 2001
- August 2001
- April 2001
- March 2001
- February 2001
- January 2001
- December 2000
- November 2000
- October 2000
- August 2000
- July 2000
- June 2000
- May 2000
- March 2000
- January 2000
- December 1999
- November 1999
- October 1999
- September 1999
Very helpful, thanks.
pretty cool! thanks! i wonder if you can get compiz-fusion running under cygwin lol
Haha! I don’t know, but it would be fun to try out! I know I was successfully been able to get KDE running under Cygwin a few years ago, but it was really slow. Compiz-Fusion would probably be really slow as well.
thats pretty sweet dude. if ur into eye-candy check out the Beryl window manager, itll blow ur mind
I can’t find "xv" on cygwin’s installation page. Do you know what section / package it is under?
janvaar,
You can get xv from here. I remember the last time I did this, I had a bit of trouble with xv. So I think I used xsetroot instead. That binary should come with the X windows package on Cygwin.
Thanks got it working w/ cygwin. One hiccup I ran into on the way is when building aterm from the source. I got an error regarding an unsupported parameter "-rdynamic". I did some digging and found that the copy of gcc that comes with cygwin expects "–rdynamic" with two dashes.
Janvaar,
Yeah, I probably should have mentioned that, but it’s been a while since I compiled it from source. It’s one of the gotchas when building from source in cygwin. Glad you got it working!
[...] while ago, I wrote up a quick guide about running X/Windows applications (specifically, aterm) without root windows on Windows, using [...]
Pingback by Rough Book » An update to running aterm (or any other X app) rootless, without a DOS console on Cygwin | September 9, 2009
best for you for promotion code to your friends