Showing posts with label ratpoison. Show all posts
Showing posts with label ratpoison. Show all posts

command-line inspiration



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

http://www.saltycrane.com/blog/2007/10/command-line-inspiration/

You should be redirected in 2 seconds.




[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...]

How to install ratpoison with Cygwin



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

http://www.saltycrane.com/blog/2007/07/ratpoison-with-cygwin-works/

You should be redirected in 2 seconds.



Running the minimalist ratpoison window manager with Cygwin/X works. You will need to install the following Cygwin packages:

gcc-core
make
readline
xorg-x11-base
xorg-x11-devel

Here is how to install:
  1. Download ratpoison
  2. $ tar xvfz ratpoison-1.4.2.tar.gz
    $ cd ratpoison-1.4.2
    $ ./configure
    $ make
    $ make install
  3. Put the following lines in your startxwin.bat file (and remove the other old %RUN% commands):
    %RUN% XWin -rootless -clipboard -silent-dup-error
    %RUN% /usr/local/bin/ratpoison
  4. Run the startxwin.bat file

UPDATE 11/08/2007:

When I installed this the first time, I had no problems. The second time I installed, after getting a new PC, I got the following error message when running configure:

configure: error: *** Can't find X11 headers and libs
I thought the reason was because I forgot to install the xorg-x11-devel package which contains the X11 headers. But even after installing it, I still got the same error. I could not figure out the reason why configure was not finding the headers and libs. So after searching the GNU autoconf manual, I found a way to specify the X11 headers and libs on the command line.
./configure --x-includes=/usr/X11R6/include/X11/ --x-libraries=/usr/X11R6/lib/
This did the trick. I'm not sure why it worked the first time and not the second time. See the GNU Autoconf manual for more information about the configure script.

See also Cygwin, X, ratposoin, screen, rxvt setup
[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.