.screenrc:

backtick 1 0 10   /usr/bin/cpu-screen
backtick 2 0 30   /usr/bin/ip-screen
backtick 3 0 5    /usr/local/bin/bat_state.pyc
backtick 4 0 5    /usr/local/bin/meminfo.pyc

# Wich screen windows should start
screen -t top 0 nice top
screen -t irssi 1 nice irssi
screen 2 zsh
# Local in META Screen by lefant
# screen -t localhost 1 screen -S local -d -RR 

# use %n to display the window number and %t for its title:
  activity              "activity in %n (%t) [%w:%s]~"

# pass on the "beep" (CTRL-G) by adding a '~':
  bell                  "bell     in %n (%t) [%w:%s]~"

# pow_detach_msg:       Message shown when session
  pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended."

# vbell_msg:            Message shown when the
  vbell_msg             " *beep* "


defutf8               on  
login                 off 
deflogin              off 
startup_message       off 
vbell                 on  
bell_msg        'Bell in %n'

termcapinfo xterm*|linux*|rxvt*|Eterm* OP

defscrollback         1000
#hardcopydir           ~/.screen
hardcopy_append       on  
shell                 zsh 

hardstatus alwayslastline
#caption always "%{wk}%?%-Lw%?%{kW}%n*%f %t%?(%u)%?%{wk}%?%+Lw"
caption always "%{b k}[ %{r}$USER@%{b}%H %{b}]%{w}[ %1` ]%{C}[ %4` ]%{B}[%= %2` %= ]%-62=%{Y}[ %{Y}%l ]%{b}[ %3` ]%{g}[ %0c ]%{w}[ %D %d.%m.%Y ]"
hardstatus string "%{g}%=%?%-Lw%?%{=b kR}(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= kw}%?%+Lw%?%?%=%{g}"

sorendition 10 99 # default!

#idle 600 eval "screen cmatrix -o -f -u 9 -C red -s" "idle 0"

#usefull binds
  bind 'K' kill
  bind 'I' login on
  bind 'O' login off
  bind '}' history
  bind Q quit
  bind G screen -t 'google'    w3m www.google.com
  bind H screen -t HeiseTicker w3m www.heise.de/newsticker/pda/data/paket4.html
  bind X lockscreen

/usr/local/bin/bat_info.py (compile with py_compilefiles)

import re
import string

state = open("/proc/acpi/battery/BAT0/state","r").readlines()
info = open("/proc/acpi/battery/BAT0/info","r").readlines()


aktuell = string.join(re.findall("[0-9]", state[4]), '')
design = string.join(re.findall("[0-9]", info[1]), '')
full = string.join(re.findall("[0-9]", info[2]), '')

aktuell = float(aktuell)
design = float(design)
full = float(full)
print "%.2f | %.2f" %((100/(design/aktuell)), (100/(design/full)))

/usr/local/bin/meminfo.py

import re
import string

mem = open("/proc/meminfo","r").readlines()

all = float(string.join(re.findall("[0-9]",mem[0]), ''))/1048576
free = float(string.join(re.findall("[0-9]",mem[1]), ''))/1048576
swapall = float(string.join(re.findall("[0-9]",mem[11]), ''))/1048576
swapfree = float(string.join(re.findall("[0-9]",mem[12]), ''))/1048576

print "%.2f/%.2f | %.2f/%.2f" %(free,all,swapfree,swapall)

Get your ip-screen and cpu-screen from GRML!

DebianWiki: SebastianBachmann/Screenrc (last edited 2008-11-27 18:51:13 by SebastianBachmann)