###############################################################################
#    Screen common profile
#      This GNU Screen configuration profile is intended to roughly
#      approximate a graphical desktop, inspired by the Ubuntu Gnome Desktop.
#
#    Copyright (C) 2008 Canonical Ltd.
#
#    Authors: Dustin Kirkland <kirkland@canonical.com>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, version 3 of the License.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
###############################################################################

# Now, let's override with our customizations
startup_message off
vbell off
msgwait 1
defutf8 on

# Define status commands
#   Use prime number intervals, to decrease collisions, which
#   yields some less expensive status updates.
#   ~86000 ~1 day
#   ~600   ~10 minutes
#   ~180   ~3 minutes
#   ~60    ~1 minute
backtick 10 	9999999	9999999		byobu-janitor
backtick 11	9999999	9999999		printf "\005-1="
backtick 12	9999999	9999999		byobu-status color
backtick 99  	9999999	9999999		byobu-status logo
backtick 100	599	599		byobu-status release
backtick 101 	7	7		byobu-status updates_available
backtick 102 	5	5		byobu-status reboot_required
backtick 103 	2	2		byobu-status cpu_freq
backtick 104 	43	43		byobu-status cpu_count
backtick 105 	47	47		byobu-status mem_available
backtick 106 	2	2		byobu-status load_average
backtick 107 	13	13		byobu-status mem_used
backtick 108 	601	601		byobu-status ec2_cost
backtick 109 	607	607		byobu-status hostname
backtick 110 	86029	86029		byobu-status whoami
backtick 111 	9999999	9999999		byobu-status menu
backtick 112 	9999999	9999999		byobu-status arch
backtick 113 	61	61		byobu-status battery
backtick 114 	11	11		byobu-status users
backtick 115 	29	29		byobu-status uptime
backtick 116 	7	7		byobu-status processes
backtick 117 	3	3		byobu-status network
backtick 118 	9999999	9999999		true
backtick 119 	17	17		byobu-status wifi_quality
backtick 120 	9999999	9999999		byobu-status date
backtick 121 	9999999	9999999		byobu-status time
backtick 122 	127	127		byobu-status ip_address
backtick 123 	13	13		byobu-status disk
backtick 124 	9999999	9999999		true
backtick 125 	19	19		byobu-status cpu_temp
backtick 126 	9999999	9999999		true
backtick 127 	5	5		byobu-status mail
backtick 128 	23	23		byobu-status fan_speed
backtick 129 	67	67		byobu-status apport
backtick 130 	5	5		byobu-status custom
backtick 131 	53	53		byobu-status services
backtick 132 	11	11		byobu-status time_utc

hardstatus alwayslastline

# Turns off alternate screen switching in xterms,
# so that text in screen will go into the xterm's scrollback buffer:
termcapinfo xterm* ti@:te@
altscreen on

# Enable 256 color terminal
attrcolor b ".I"
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
defbce "on"

# Log 10000 lines
defscrollback 10000

# Monitor windows
defmonitor on
activity ""

# Maintain SSH_AUTH_SOCK link
setenv SSH_AUTH_SOCK /var/run/screen/S-$USER/byobu.ssh-agent

source $HOME/.byobu/keybindings

# Window tabs, second to last line
caption always "%12`%?%-Lw%50L>%?%{=r}%n*%f %t%?(%u)%?%{-}%12`%?%+Lw%?%11` %=%12`%110`%109`%122`%111`%10`%<"

# Status string, last line
hardstatus string '%99`%{-}%{=r}%12` %100`%112`%= %130`%102`%101`%129`%131`%127`%114`%115`%108`%128`%125`%126`%113`%119`%117`%116`%106`%104`%103`%105`%107`%123`%132`%120`%121`'

# NOTE: Older version of screen have an arbitrary limit of only being able
# to change colors 16 times in this 'hardstatus string'.
# Ubuntu (fixed in Jaunty):
#  * https://bugs.launchpad.net/bugs/315871
# Upstream:
#  * http://savannah.gnu.org/bugs/?22146
