leponceau.org

Programming And Stuff, You Know The Thing…

SCREEN and top customization examples

Posted at — Feb 19, 2019

Final result / Preview

TODO

I’d like to move the memory usage bar to the screen status line (incl. the percentage number). Tell me if you find a solution for that.

Examples

The following configuration examples have been tested on Ubuntu 18.

.screenrc example

# enter copy mode with CTRL-a CTRL-ESC (to scroll back)
# and leave with ESC
termcapinfo xterm ti@:te@
termcapinfo xterm-color ti@:te@
# make top/vim etc. work on remote machines
term screen.xterm-new
# faster startup
startup_message off
# bind window list to CTRL-a SPACE
bind ' ' windowlist -b
shell -${SHELL}
# display cpu load and datetime
caption always "%{= kc}%H (system load: %l)%-21=%{= .m}%D %d.%m.%Y %0c"
# split into top and bottom windows
split
# enlarge top window
#resize 40
resize max
resize 70%
focus
# split lower window into lower left and lower right windows
split -v
# start top in lower left window
screen 8 top
# start I/O monitor in lower right region
focus
screen 9 bash -c "exec iostat -m 3 /dev/sd?"
# start BASH command shell in top region
focus
screen 0 bash -l
# increase scrollback buffer:
#defscrollback 5000
#
# some important keys:
# CTRL-a TAB - next region
# CTRL-a ? - help
# CTRL-a : - screen command interface
# CTRL-a \ - quit everything
# CTRL-a c - create new window
# CTRL-a n,p - switch between windows
# CTRL-a SPACE - show window list

https://github.com/jjYBdx4IL/snippets/blob/master/dot-screenrc

.toprc example

These config files contain non-text, so you need to download it directy:

https://github.com/jjYBdx4IL/snippets/blob/master/dot-toprc