# If both the lifespan and the autorefresh parameters are zero,
# the backtick program is expected to stay in the background and generate output once in a while. 
# In this case, the command is executed right away and screen stores the last line of output. 
# If a new line gets printed screen will automatically refresh the hardstatus or the captions.
backtick 2 0 0 $HOME/.config/screen/battery-rate
hardstatus alwayslastline
# H hostname of the system
# https://www.gnu.org/software/screen/manual/html_node/String-Escapes.html
hardstatus string '%{= kg}[%{G}%H%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}]%?[%2`]%?[%{W}%c%{g}]'

defscrollback 10000

# http://stackoverflow.com/questions/17868652/screen-how-to-turn-on-alternate-screen
altscreen on

# no welcome message
startup_message off

# all characters cleared will be displayed in the current background color
defbce on

# mouse tracking allows to switch region focus by clicking
mousetrack on

screen ranger

# navigating regions
bind h focus left
bind j focus down
bind k focus up
bind l focus right

# resizing regions
bind -c resize h eval "resize -h -5" "command -c resize"
bind -c resize j eval "resize -v +3" "command -c resize"
bind -c resize k eval "resize -v -3" "command -c resize"
bind -c resize l eval "resize -h +5" "command -c resize"
bind R eval "command -c resize" "echo resize"

# http://aperiodic.net/screen/man:default_key_bindings