Home

Search this site:
 

Horshack’s
very
own site

 

This is Bavaria, Germany!
You will find links to Perl,
bootdisks for system administration,
a lot of Linux,
Windows administration
and some personal belongings.
Screen

Screen

.screenrc with always visible statusline

 It looks like this:

screen_rc.gif

I was told this is a work from https://help.ubuntu.com/9.04/serverguide/C/screen-profiles.html and https://launchpad.net/byobu

# ------------------------------------------------------------------------------
# SCREEN SETTINGS
# ------------------------------------------------------------------------------

startup_message off
deflogin on
windowlist title "Select Window"
vbell off
defscrollback 1000
defnonblock 5

# ------------------------------------------------------------------------------
# SCREEN KEYBINDINGS
# ------------------------------------------------------------------------------

register n "^a^c^aA"
register w "^a\""

bindkey -k k1 title					# F1  | Change title
bindkey -k k2 process n					# F2  | Create new window (and name it)
bindkey -k k3 prev					# F3  | Previous Window
bindkey -k k4 next					# F4  | Next Window
bindkey -k k5 process w					# F5  | Window List
bindkey -k k6 detach					# F6  | Detach from this session
bindkey -k k7 copy					# F7  | Enter copy/scrollback mode
bindkey -k k8 kill					# F8  | Kill current window
bindkey -k k9 quit					# F9  | Exit
bindkey -k F2 lockscreen				# F12 | Lock this terminal

# ------------------------------------------------------------------------------
# TERMINAL SETTINGS
# ------------------------------------------------------------------------------

termcapinfo vt100 dl=5\E[M
termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007
termcapinfo xterm*|linux*|rxvt*|Eterm* OP
termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'
termcapinfo xterm* ti@:te@
altscreen on

# ------------------------------------------------------------------------------
# STATUS LINES
# ------------------------------------------------------------------------------

backtick 10 86400 86400 printf "\005{= Wk}"			# default text color
backtick 20 86400 86400 printf "\005{= WK}"			# alternative text color
#backtick 10 86400 86400 printf "\005{= Wk}"			# default text color
#backtick 20 86400 86400 printf "\005{= WK}"			# alternative text color

backtick 100 86400 86400 uname -m				# arch
backtick 101 3600 3600 hostname -i 				# ip address 
backtick 102 2 2 printf `ps -e | wc -l`

hardstatus alwayslastline
caption always "%{= Wb}%-Lw%{= wb}%50>%n%f* %t%{-}%+Lw%<"
hardstatus string '%20`host %10`%H %20`| ip %10`%101`%20`| arch %10`%100` %20`| load %10`%l %20`|%=%20`gnu/screen %10`%Y-%m-%d %0c:%s'
#hardstatus string '%{= WK}%99` host %{= Wk}%H %{= WK}load %{= Wk}%l %= %{= WK}gnu/screen %{= Wk}%Y-%m-%d %0c:%s'

# ------------------------------------------------------------------------------
# STARTUP SCREENS
# ------------------------------------------------------------------------------

.screenrc opens several screens and titles them

You can easily have 5 screens lieing on top of each other. This is my .screenrc, named a little bit different to build an environment for special development projects:

# File ~/screen_catalyst
# Usage: screen -c screenstart

#   Basedirectory for all new screens
# chdir /home/horshack/catalyst/project_yachting/Yacht
#   or for new screens to be in the current directory and not home:
chdir .
# no visual bell with flickering screen
vbell off
# window 0: to let a catalyst server run
screen bash
title "Server"

# window 1: be in the testing-directory with vi
screen bash -c 'cd t; ls -l; exec bash'
title "t/vi"

# window 1: be in the testing-directory, running tests
screen bash -c 'cd t; ls -l; exec bash'
title "t/run"




# Jump to window 0
select 0

Screen - command cheat-sheet

Some links:

Copy and paste

ctrl-a [     Starts copy mode, 
             first "enter" to start copying
             next "enter" to end copying

ctrl-a ]     Pastes what's in your copy/paste-buffer

Split screen

It looks like this:

ctrl-a S     Splits a screen into two "regions"

ctrl-a tab   Go to next region

ctrl-a Q     Kill all regions except the one you are in
Impressum