From 0a7a41eb1ebbbed7814e47690db8248576e4ed47 Mon Sep 17 00:00:00 2001 From: Josh Kearney Date: Wed, 4 Apr 2012 17:47:56 -0500 Subject: [PATCH] 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 --- AUTHORS | 1 + stack.sh | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 86456159b6..820a677385 100644 --- a/AUTHORS +++ b/AUTHORS @@ -17,6 +17,7 @@ Jason Cannavale Jay Pipes Jesse Andrews Johannes Erdfelt +Josh Kearney Justin Shepherd Ken Pepple Kiall Mac Innes diff --git a/stack.sh b/stack.sh index 444a738154..c82c296913 100755 --- a/stack.sh +++ b/stack.sh @@ -748,6 +748,10 @@ EOF restart_service mysql fi +if [ -z "$SCREEN_HARDSTATUS" ]; then + SCREEN_HARDSTATUS='%{= .} %-Lw%{= .}%> %n%f %t*%{= .}%+Lw%< %-=%{g}(%{d}%H/%l%{g})' +fi + # Our screenrc file builder function screen_rc { SCREENRC=$TOP_DIR/stack-screenrc @@ -755,7 +759,7 @@ function screen_rc { # Name the screen session echo "sessionname stack" > $SCREENRC # Set a reasonable statusbar - echo 'hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%< %= %H"' >> $SCREENRC + echo 'hardstatus alwayslastline "$SCREEN_HARDSTATUS"' >> $SCREENRC echo "screen -t stack bash" >> $SCREENRC fi # If this service doesn't already exist in the screenrc file @@ -792,7 +796,7 @@ function screen_it { screen -d -m -S stack -t stack -s /bin/bash sleep 1 # set a reasonable statusbar -screen -r stack -X hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%< %= %H" +screen -r stack -X hardstatus alwayslastline "$SCREEN_HARDSTATUS" # Horizon # -------