# Features which are only available in (very) recent screen releases or in
# current Git are marked with "(GIT)" so they can be removed by the setup
# script on machines with older versions.
+#
+# (BATTERY) is only used on laptops, (ROOT) only if running as root.
+# Copyright (C) 2011-2012 Simon Ruderich
+#
+# This file 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, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file 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 file. If not, see <http://www.gnu.org/licenses/>.
+
+
+# Automatically lock the screen after 10 minutes of inactivity if running as
+# root.
+idle 600 lockscreen # (ROOT)
# Don't display startup message.
startup_message off
# for window borders in split mode).
sorendition = Bw
+# Display current battery charge if running on a laptop. Redisplay every 3
+# minutes.
+backtick 1 180 180 $HOME/.shell/bin/battery.pl -s # (BATTERY)
+
# Make sure the temporary variable we use is empty. Thanks to
# http://gist.github.com/133000 for the idea to use setenv and to TauPan in
# #screen on Freenode (2010-03-10 16:11 CET) for reminding me of it and
caption always "$s"
unsetenv s
# Always display the status line with open windows and the hostname.
-setenv s "$s%w" # - number and names of windows
-setenv s "$s%=" # - right align the following text
-setenv s "$s%l" # - load average
-setenv s "$s " # - space
-setenv s "$s%H" # - hostname
+setenv s "$s%w" # - number and names of windows
+setenv s "$s%=" # - right align the following text
+setenv s "$s%l" # - load average
+setenv s "$s " # - space
+setenv s "$s%H" # - hostname
+setenv s "$s " # - space (BATTERY)
+setenv s "$s%1`" # - battery status (BATTERY)
hardstatus alwayslastline "$s"
unsetenv s