# ~/.screenrc
#
# Thanks to:
# https://www.gnu.org/software/screen/manual/screen.html#Command-Summary
# http://www.debian-administration.org/articles/560
# http://www.alexandrulazar.com/junk/articles/.screenrc

startup_message off

# defshell -bash # dash makes it a login shell
defshell zsh
# shelltitle "$ |zsh"

vbell on # no annoying audible bell
vbell_msg "  !! Something interesting has happened !!  "
activity "%c activity -> %n%f %t"
bell "%c bell -> %n%f %t^G"

autodetach on  # autodetach session on hangup instead of terminating screen completely
altscreen on
defscrollback 5000
defutf8 on
defnonblock on
msgwait 1 # message timeout 1 second

defmonitor on # turn monitoring on
activity "%"  # tell me when stuff happens!

# allow bold colors - necessary for some reason
attrcolor b ".I"

# term xterm-256color
term screen-256color
termcapinfo xterm* 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
termcapinfo xterm* ti@:te@ # make scrollbar work

# erase background with current bg color
defbce on

bind R eval "source $HOME/.screenrc" "echo '.screenrc reloaded!'"
bind % screen -t htop htop

# read and write screen clipboard to X clipboard.
bind > eval writebuf "exec sh -c 'xsel -bi </tmp/screen-exchange'"
bind < eval "exec sh -c 'xsel -bo >/tmp/screen-exchange'" readbuf

screen 0
# screen 1

select 0

backtick 0 0 0 whoami # use "%0`" to equal the output
# backtick 1 0 5 $HOME/bin/screen_disk_usage # use "%1`" to equal the output

hardstatus alwayslastline "%{.bW} %-w%{.rW}%n %t%{-}%+w %=%{..} %l | %0`@%H | %D %c:%s %d.%m.%Y"