]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - screenrc.in
screenrc: Lock screen after 10 minutes of inactivity for root.
[config/dotfiles.git] / screenrc.in
index 7b74b11f25a00c283fb50440301db61dd87f9e65..ae278438876f3cfea8f28ef3761c911de76e5d82 100644 (file)
@@ -1,6 +1,16 @@
 # Screen configuration file.
+#
+# 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.
 
 
+# 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
 
@@ -10,6 +20,12 @@ vbell on
 # Increase the scrollback buffer.
 defscrollback 10000
 
+# Ignore case when searching.
+ignorecase on
+
+# I prefer zsh as my shell.
+shell zsh
+
 
 # TERMINAL
 
@@ -27,18 +43,38 @@ attrcolor b ".I"
 # 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
+# searching it again.
+unsetenv s
+
 # Always display the caption.
-caption always "%{= Bw}%3n %t"
-# %{= Bw} - white on light blue background, also reset all attributes
-#           (necessary so everything is displayed correctly)
-# %3n     - window number
-# %t      - window name
+setenv s "$s%{= Bw}" # - white on light blue background, also reset all
+                     #   attributes (necessary so everything is displayed
+                     #   correctly)
+setenv s "$s%?%P"    # - is copy mode enabled? (GIT)
+setenv s "$s%{= wB}" #   - if so change colors to light blue on white (GIT)
+setenv s "$s%?"      # - end if (GIT)
+setenv s "$s%3n"     # - window number
+setenv s "$s "       # - space
+setenv s "$s%t"      # - window name
+caption always "$s"
+unsetenv s
 # Always display the status line with open windows and the hostname.
-hardstatus alwayslastline "%w%=%l %H"
-# %w - number and names of windows
-# %= - right align the following text
-# %l - load average
-# %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
 
 
 # BINDINGS
@@ -47,7 +83,9 @@ hardstatus alwayslastline "%w%=%l %H"
 # probably don't want to copy this.
 bind K  # kill
 bind k  # kill
+bind ^K # kill
 bind \\ # quit
+bind ^\ # quit
 bind ^Z # suspend
 bind z  # suspend
 bind ^S # xoff
@@ -57,6 +95,20 @@ bind q  # xon
 bind ^G # visual bell
 bind D  # power detach
 
+# Bindings for fast switching to windows 10 to 19. Thanks to skizzhg in
+# #screen on Freenode (2010-10-31 21:49 CET) for the suggestion.
+bind -c window 0 select 10
+bind -c window 1 select 11
+bind -c window 2 select 12
+bind -c window 3 select 13
+bind -c window 4 select 14
+bind -c window 5 select 15
+bind -c window 6 select 16
+bind -c window 7 select 17
+bind -c window 8 select 18
+bind -c window 9 select 19
+bind ; command -c window
+
 # Run urlview on current screen content. Very useful to follow links. Make
 # sure hardcopy_append is off before using this command.
 bind ^B eval "hardcopy $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview"