GNU Screen, Window Manager.

June 26, 2010 at 7:54 am

GUI is for the weak. Meet my window manager, GNU screen:

Small image of GNU screen setup

0. Build screen from source to fix the slowdown when scrolling in a vertical split.

1. This is my .screenrc with keyboard shortcuts and a nifty status bar.  –help?

Control + Up:  previous split screen
Control + Down: next split screen
Control + Left:  previous screen window
Control + Right: next screen window
F1: kill current tab
F2: write paste buffer to file
F3: split horizontally
F4: split vertically
F5: remove single split
F6: remove all splits
F7: urlview pulls URL's from your current output, very useful
F8: new tab
F9: resize split +1 line
F10: resize split -1 line

2. Install screen_ssh.sh so your window title automatically renames to your ssh destination.  To have the title revert after closing your shell follow this.

3. color = readability.  Install color wrapper to colorize your terminal output.  Alias man to use most as its pager.  Use the following for a colorful prompt with $? in $2:

00:43:18 0 user@hostname:~/$

\[\033[1;36m\]\t\[\033[0m\] `LastExitValue=$?; if [ $LastExitValue = 0 ]; then echo \[\033[1\;32m\]$LastExitValue\[\033[0m\]; else echo \[\033[1\;31m\]$LastExitValue\[\033[0m\]; fi` \[\033[1;34m\]\u@\h\[\033[0m\]:\[\033[1;33m\]\w\[\033[0m\]\[\033[1;32m\]\$\[\033[0m\]

To remove color use:  s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g

4. Yakuake is the best terminal emulator. Configure these shortcuts:

Shift + Left: previous shell
Shift + Right: next shell
F11: full screen
F12: drop down

2 Comments »

  1. How would you compare GNU screen to tiling window managers such as Awesome or Xmonad? I gave screen a try a few years ago, but did not use it enough to form an honest opinion about it.

    Have you investigated a tiling WM? Many are incredibly scriptable such that you can mold your environment into whatever you want it to be. (And they make a point to stay out of your way, too.) My only complaint is that there are almost too many of them to try–the community hasn’t settled on two or three ‘best’ approaches.

    Comment by Brandon Thomas — June 27, 2010 @ 5:01 am
  2. I find GNU screen is much more portable: the binary is on almost every shell I log into. It is easier to copy a .screenrc file rather than install a window manager and being able to detach and re-attach your environment from any terminal (eg., my phone) is indispensable.

    Comment by Alexandru — June 27, 2010 @ 5:20 am

RSS feed for comments on this post. TrackBack URI

Leave a comment