Showing posts with label urxvt. Show all posts
Showing posts with label urxvt. Show all posts

How to get anti-aliased fonts for Cygwin with urxvt



This is my OLD blog. I've copied this post over to my NEW blog at:

http://www.saltycrane.com/blog/2007/09/how-to-get-anti-aliased-fonts-for/

You should be redirected in 2 seconds.



urxvt, or rxvt-unicode, is a better alternative to rxvt and xterm that supports xft (read anti-aliased) fonts. Here's how to make your terminal pretty:

You need: Cygwin with X, urxvt, and fontconfig (all available through Cygwin's setup utility)
  1. To see the list of available fonts run: $ fc-list
  2. Select a font and put it in your ~/.Xdefaults file. e.g.
    URxvt*font: xft:Bitstream Vera Sans Mono:size=12
    Urxvt*boldFont: xft:Bitstream Vera Sans Mono:size=12:style=Bold
  3. Run: $ urxvt
For reference, here is the list of fonts I got:
Bitstream Charter:style=Bold
Bitstream Charter:style=Bold Italic
Bitstream Charter:style=Italic
Bitstream Charter:style=Regular
Bitstream Vera Sans Mono:style=Bold
Bitstream Vera Sans Mono:style=Bold Oblique
Bitstream Vera Sans Mono:style=Oblique
Bitstream Vera Sans Mono:style=Roman
Bitstream Vera Sans:style=Bold
Bitstream Vera Sans:style=Bold Oblique
Bitstream Vera Sans:style=Oblique
Bitstream Vera Sans:style=Roman
Bitstream Vera Serif:style=Bold
Bitstream Vera Serif:style=Roman
Charter:style=Bold
Charter:style=Bold Italic
Charter:style=Italic
Charter:style=Regular
Clean:style=Regular
ClearlyU Alternate Glyphs:style=Regular
ClearlyU PUA:style=Regular
ClearlyU:style=Regular
Courier 10 Pitch:style=Bold
Courier 10 Pitch:style=Bold Italic
Courier 10 Pitch:style=Italic
Courier 10 Pitch:style=Regular
Courier:style=Bold
Courier:style=Bold Italic
Courier:style=Bold Oblique
Courier:style=Italic
Courier:style=Oblique
Courier:style=Regular
Cursor:style=Regular
Fixed:style=Bold
Fixed:style=Bold SemiCondensed
Fixed:style=ja
Fixed:style=ko
Fixed:style=Oblique
Fixed:style=Oblique SemiCondensed
Fixed:style=Regular
Fixed:style=SemiCondensed
Helvetica:style=Bold
Helvetica:style=Bold Oblique
Helvetica:style=Oblique
Helvetica:style=Regular
Lucida:style=Sans
Lucida:style=Sans Bold
Lucida:style=Sans Bold Italic
Lucida:style=Sans Italic
LucidaBright:style=Italic
LucidaBright:style=Regular
LucidaTypewriter:style=Sans
LucidaTypewriter:style=Sans Bold
Luxi Mono:style=Bold
Luxi Mono:style=Bold Oblique
Luxi Mono:style=Oblique
Luxi Mono:style=Regular
Luxi Sans:style=Bold
Luxi Sans:style=Bold Oblique
Luxi Sans:style=Oblique
Luxi Sans:style=Regular
Luxi Serif:style=Bold
Luxi Serif:style=Bold Oblique
Luxi Serif:style=Oblique
Luxi Serif:style=Regular
New Century Schoolbook:style=Bold
New Century Schoolbook:style=Bold Italic
New Century Schoolbook:style=Italic
New Century Schoolbook:style=Regular
Newspaper:style=Regular
Terminal:style=Bold
Terminal:style=Regular
Times:style=Bold
Times:style=Bold Italic
Times:style=Italic
Times:style=Regular
Utopia:style=Bold
Utopia:style=Bold Italic
Utopia:style=Italic
Utopia:style=Regular

[Read the full post...]

Cygwin, X, ratposoin, screen, rxvt setup



This is my OLD blog. I've copied this post over to my NEW blog at:

http://www.saltycrane.com/blog/2007/09/cygwin-x-ratposoin-screen-rxvt-setup/

You should be redirected in 2 seconds.



Here are my configuration files for my current Cygwin, X, ratpoison, screen, urxvt, bash setup.

General Cygwin and bash
  • I changed filename completion to be case-insensitive since we're on Windows. To do this, see the last line in ~/.bashrc and the last line in ~/.inputrc below.
  • I changed the "/cygdrive" prefix to just "/". To do this, type this command once: "mount -s --change-cygdrive-prefix /"
  • I added aliases to use "grep" and "ls" with color. And I added aliases to start various windows applications. See ~/.bashrc.
urxvt
  • urxvt (rxvt-unicode) is a better alternative to rxvt and xterm. See the ~.Xdefaults file for my urxvt customizations. I chose an anti-aliased font, removed the scrollbar, changed the background to dark blue and the foreground to light yellow, and set the number of saved lines to 8000. (Note, to scroll, hit SHIFT+PGUP or SHIFT+PGDN).
ratpoison and screen
  • GNU Screen is a terminal multiplexer which can be used to manage terminal sessions. Ratpoison is a simple keyboard driven window manager largely modeled after GNU Screen which is used as an alternative to complex window managers such as Gnome or KDE. Most of the ratpoison and screen configuration is copied from Mark Pilgrim. The layering, as I understand it, is: the Windows XP OS runs the Cygwin/X environment which runs the ratpoison window manager which runs the urxvt terminal emulator which runs the screen terminal multiplexer which runs the bash command shell.
Update 5/2/2008: I learned how to paste in urxvt (actually bash). See my post, How to paste in Cygwin bash using CTRL+V.

startxwin.bat (windows batch file)
@echo off
SET DISPLAY=127.0.0.1:0.0
SET CYGWIN_ROOT=\cygwin
SET RUN=%CYGWIN_ROOT%\bin\run -p /usr/X11R6/bin
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

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 OS_NT
echo startxwin.bat - Starting on Windows 95/98/Me
goto STARTUP

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

:STARTUP
%RUN% XWin -rootless -clipboard -silent-dup-error
%RUN% /usr/local/bin/ratpoison
~/.ratpoisonrc
# initial frame and window setup
hsplit
focusright
exec urxvt -e screen -RD

# use Pause as prefix key instead of Ctrl-T
escape Pause

# use global cursor positioning (not per-frame)
warp off

# set appearance of ratpoison status messages and input line
set bgcolor black
set fgcolor grey95
set font -b&h-lucidatypewriter-bold-r-normal-sans-18-180-75-75-m-110-iso8859-1
set inputwidth 1247
set bargravity ne
set barpadding 4 4
msgwait 3

# top-level shortcuts (don't require prefix key)
definekey top C-M-Up focusup
definekey top C-M-Down focusdown
definekey top C-M-Left focusleft
definekey top C-M-Right focusright
~/.Xdefaults
URxvt*background: #000033
URxvt*foreground: #ffffcc
! run "fc-list" for a list of available fonts
URxvt*font: xft:Bitstream Vera Sans Mono:size=12
Urxvt*boldFont: xft:Bitstream Vera Sans Mono:size=12:style=Bold
URxvt*scrollBar: False
URxvt*scrollTtyOutput: False
URxvt*scrollTtyKeypress: True
URxvt*secondaryScroll: True
URxvt*saveLines: 8000
~/.screenrc
shell /usr/bin/bash

# scrollback
defscrollback 8000

# Window numbering starts at 1
bind c screen 1
bind 0 select 10
screen 1

# Create initial windows
screen -t home 1
screen -t myproj 1
screen -t pydev 1
screen -t docs 1
screen -t misc 1

# Set the caption on the bottom line:
# window-list   am/pm
# from http://diveintomark.org/public/2007/03/screenrc
caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= %1` %m/%d/%y %C:%s%a"

# use backtick for prefix key instead of Ctrl-A
escape ``

# use regular audible bell
vbell off

# skip intro
startup_message off

# detach on disconnect
autodetach on
~/.bashrc
# prompt 
# see http://www.ibm.com/developerworks/linux/library/l-tip-prompt/
export PS1="\n\e[31;1m\w\n\e[0m\$ "

# cygwin aliases
alias where='type -a'
alias grep='grep --color'
alias ls='ls --color=auto'
alias la='ls -dlAog --time-style="+%Y %m/%d %H:%M" .*; ls -Xlog --time-style="+%Y %m/%d %H:%M"'
alias ll='ls -Xlog --hide "*~" --hide "*.bak" --hide "*.orig" --time-style="+%Y %m/%d %H:%M"'
alias dir='ll'
alias ec='emacsclient -n '

# directory aliases
alias home='cd ~'
alias progfiles='cd /c/Program\ Files'
alias incoming='cd ~/incoming'

# windows aliases
alias firefox='/c/Program\ Files/Mozilla\ Firefox/firefox.exe &'
alias eclipse='/c/Programs/eclipse3.3/eclipse.exe -vmargs -Xms192m -Xmx192m &'
alias serena='/c/Program\ Files/Serena/vm/win32/bin/pvcsvmnt.exe &'
alias kdiff='/c/Program\ Files/KDiff3/kdiff3'
alias explorer='/c/windows/explorer /e /root,'
alias outlook='/c/Program\ Files/Microsoft\ Office/OFFICE11/OUTLOOK.EXE &'
alias taskmgr='/c/windows/system32/taskmgr.exe &'
alias word='/c/Program\ Files/Microsoft\ Office/OFFICE11/WINWORD.EXE '
alias excel='/c/Program\ Files/Microsoft\ Office/OFFICE11/EXCEL.EXE '
alias powerpoint='/c/Program\ Files/Microsoft\ Office/OFFICE11/POWERPNT.EXE '
alias acrobat='/c/Program\ Files/Adobe/Acrobat/Acrobat.exe '

# Get bash filename completion to be case insensitive - there is also a line in .inputrc
shopt -s nocaseglob
~/.inputrc
# the following line is actually
# equivalent to "\C-?": delete-char
"\e[3~": delete-char

# VT
"\e[1~": beginning-of-line
"\e[4~": end-of-line

# kvt
"\e[H": beginning-of-line
"\e[F": end-of-line

# rxvt and konsole (i.e. the KDE-app...)
"\e[7~": beginning-of-line
"\e[8~": end-of-line

# VT220
"\eOH": beginning-of-line
"\eOF": end-of-line

# Get bash filename completion to be case insensitive - see also .bashrc
set completion-ignore-case on

[Read the full post...]

My software tools list



This is my OLD blog. I've copied this post over to my NEW blog at:

http://www.saltycrane.com/blog/2007/08/current-configuration/

You should be redirected in 2 seconds.



Below is a table of my current software configuration. If you notice a lot of "I switched from ..." statements, keep in mind that I am a programmer who likes shiny things.

Category Currently using Comments
Operating System Ubuntu 8.04, Windows XP, Windows Vista Work Desktop: Ubuntu Hardy via coLinux on Windows XP and Cygwin when needed.
Home Laptop: dual-boot Windows Vista with Cygwin and Ubuntu Hardy
Home Desktop: Ubuntu Hardy

I am in the process of migrating from Windows to Linux. My first Ubuntu install was in 2007 (dual-boot) and I got my first Windows-free machine in 2008. Currently I am using Cygwin and coLinux when on Windows. Cygwin integrates better with Windows applications, but coLinux is super fast and allows you to run a full Linux distro on top of Windows. Windows does have some advantages, but overall I prefer Linux.

I don't have enough experience with OSX to draw any authoritative conclusions, though I think Mark Pilgrim has biased me against Apple. Also, I think Linux's free as in beer (and somewhat related free as in speech) characteristics vs. Mac's expensive (and somewhat related proprietary) characteristics resonate with the cheap engineer in me.

Additional Linux vs. Mac commentary from some A-list geeks:
Window Manager wmii Dynamic, tiling, scriptable window manager that doesn't require a mouse. It sucks less.

I switched from ratpoison at the same time I started using coLinux because running native Linux allowed me to use any Linux window manager as well.

Recently, some have switched from wmii to xmonad, the new Haskell tiling window manager. It has some nice features over wmii, including dual head support, but after a brief excursion, I slightly prefer wmii's way of doing things.

If you're a hard core Lisper, stumpwm is the window manager for you. It has a REPL. This one seems a little too hard core for me, especially since I don't know Lisp (yet).

Other options: ion, dwm, awesomewm

Editor/IDE GNU Emacs Switched from Eclipse in 2007. It was a slow transition, but worth it. I think Emacs is definitely worth the investment if you do a lot of coding.

Terminal urxvt +
screen
urxvt supports xft (anti-aliased) fonts, real transparency (not that I actually use transparency with wmii), and fading (which I do use with wmii) and it is much lighter than gnome-terminal or konsole. screen allows me to switch terminal sessions without ugly tabs, attach to remote sessions, search through the scrollback buffer, and more.

Version Control System Mercurial Switched from Subversion in June 2007. The merging in Mercurial is very nice and can be done without thinking. I do miss Subversion/Subclipse's revision history viewer, file compare, and ability to isolate files apart from changesets.

Compiled Language C Wouldn't mind learning C++. Although, Linus doesn't like it.

Dynamic Language Python 2.5 My love for python is strong. I switched from Perl in 2005 and have no regrets. Object-oriented, easy to read (no more TIMTOWTDI), and smart people use it. I also want to learn Javascript 2 becuase it is the "Next Big Language" and Lisp because it is the "most powerful language".

On Python vs. Ruby: from what I've read, I characterize Ruby as the more expressive language more similar to Perl (than Python is) and Python as the more regimented language. Since I like regimented, I like Python.

On Python vs. Lisp: I've concluded that I lack the intelligence to harness enough of Lisp's power to counteract its non-practicality (e.g. lack of libraries).

Some other links:
Paul Graham: Python is getting closer to Lisp (2002)
Paul Prescod: no it isn't

Web Framework Django I haven't tried much else, but Django is pretty cool.

Here are some links:
Ian Bicking: There's so much more than Rails (2005), What PHP deployment gets right (2008)

Web Browser Conkeror Not to be confused with Konqueror, Conkeror is an emacs-like, keyboard driven, scriptable, Mozilla-based web browser. I've used it almost full time since January 2008. It is still considered alpha stage software so there are a number of bugs. However, it is still pretty sweet. I use Firefox as a backup (and IE Tab for Launchcast and Netflix on Windows). Unfortunately, one of the annoying things in Firefox 2 is present in Conkeror as well-- memory leaks. Based on this Mozilla article and some brief personal experience, Firefox 3 has made fixes in this area. It would be nice if Conkeror could benefit from the Firefox 3 fixes.

Email/PIM Undecided Thunderbird?, Evolution?, Mutt?, Gnus?, Alpine?, Gmail?, Claws Mail?,

I currently use Microsoft Outlook with an Exchange Server at work. Evolution supports Exchange Server through Outlook Web Access (OWA), but I couldn't get it to work for me. Thunderbird (and I assume others) support Exchange through IMAP, but this is only available at work by special request.

Links:
Adam Gomaa chooses Claws Mail over Thunderbird, Evolution, Mutt, and Gnus (2007)

PDF Viewer KPDF Preferred over Gnome's Evince
Screen Capture KSnapshot Courtesy of Mark Pilgrim's essentials list
Graphical diff/merge KDiff3 I started using KDiff a while ago on Windows and have always liked it. I'm thinking, though, since I'm an Emacs person, I ought to use Ediff.
Updated 7/2/2008
[Read the full post...]

About

This is my *OLD* blog. I've copied all of my posts and comments over to my NEW blog at:

http://www.saltycrane.com/blog/.

Please go there for my updated posts. I will leave this blog up for a short time, but eventually plan to delete it. Thanks for reading.