From Biowiki
Jump to: navigation, search

First the disclaimer: I am a relative GNU newbie, so take everything here with a grain of salt. That being said, maybe some of this will help others avoid annoyances I've suffered through in trying to get this stuff set up.


GNU screen is very convenient for working from home. It lets you open multiple proceses in a single terminal and switch between them at will (no more sshing in multiple times just so you can use emacs and terminal simultaneously!). Better yet, you can "detach" a session, log on remotely and then "attach" the same session. Everything will be just as you left it.

I alias 'screen' to 'screen -D -R' for automatic detaching and logoff. My .screenrc is:

# Turn off the startup message.
startup_message off

# Set the caption to the active windows. 
#caption always "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"

#change the hardstatus settings to give an window list at the bottom of the
#screen, with the time and date and with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= mK}%-Lw%{= KW}%50>%n%f* %t%{= mK}%+Lw%< %{= kG}%-=%D %d %M %Y %c:%s%{-}'

# use 'C-\' instead of default 'C-a' for better ergonomics (type 'C-\a' to get effect of normal 'C-\')
escape ^\a

# New screens for various processes.
# -t flag means that the window in which the process is running
# closes when you exit the program
screen bash
screen -t bash1 1 bash
screen -t emacs 2 emacs
screen -t cluster 7 ssh myself@myself.org

# Split the windows how I like it
select 0
select 2

.bash_profile and .bashrc

.bash_profile is for login shells and .bashrc is for non-login shells. You can avoid duplicating info in both by adding to .bash_profile

# Do .bashrc if necessary.
# Aliases and all that good stuff are in .bashrc so that non-login shells
# know about them too.
if [ ! "$BASHRC" -a -f ~/.bashrc ]; then
  . ~/.bashrc


There are lots of better .emacs files out there, but here's my relatively simple one (I used Enrico Franconi's carbon enhanced emacs, a great package for writing latex, so ignore that stuff): .emacs:

-- Rob