Browse code

Make the screen hardstatus line configurable.

The default hardstatus line now includes the system load along with the hostname. Minor color changes.

Change-Id: I70ebeef0981c741dd647c0e98df3f4b7e09de9cd

Josh Kearney authored on 2012/04/05 07:47:56
Showing 2 changed files
... ...
@@ -17,6 +17,7 @@ Jason Cannavale <jason.cannavale@rackspace.com>
17 17
 Jay Pipes <jaypipes@gmail.com>
18 18
 Jesse Andrews <anotherjesse@gmail.com>
19 19
 Johannes Erdfelt <johannes.erdfelt@rackspace.com>
20
+Josh Kearney <josh@jk0.org>
20 21
 Justin Shepherd <galstrom21@gmail.com>
21 22
 Ken Pepple <ken.pepple@rabbityard.com>
22 23
 Kiall Mac Innes <kiall@managedit.ie>
... ...
@@ -748,6 +748,10 @@ EOF
748 748
     restart_service mysql
749 749
 fi
750 750
 
751
+if [ -z "$SCREEN_HARDSTATUS" ]; then
752
+    SCREEN_HARDSTATUS='%{= .} %-Lw%{= .}%> %n%f %t*%{= .}%+Lw%< %-=%{g}(%{d}%H/%l%{g})'
753
+fi
754
+
751 755
 # Our screenrc file builder
752 756
 function screen_rc {
753 757
     SCREENRC=$TOP_DIR/stack-screenrc
... ...
@@ -755,7 +759,7 @@ function screen_rc {
755 755
         # Name the screen session
756 756
         echo "sessionname stack" > $SCREENRC
757 757
         # Set a reasonable statusbar
758
-        echo 'hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%< %= %H"' >> $SCREENRC
758
+        echo 'hardstatus alwayslastline "$SCREEN_HARDSTATUS"' >> $SCREENRC
759 759
         echo "screen -t stack bash" >> $SCREENRC
760 760
     fi
761 761
     # If this service doesn't already exist in the screenrc file
... ...
@@ -792,7 +796,7 @@ function screen_it {
792 792
 screen -d -m -S stack -t stack -s /bin/bash
793 793
 sleep 1
794 794
 # set a reasonable statusbar
795
-screen -r stack -X hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%< %= %H"
795
+screen -r stack -X hardstatus alwayslastline "$SCREEN_HARDSTATUS"
796 796
 
797 797
 # Horizon
798 798
 # -------