From 9303bce6235d8c44ca8c949948465be243f1a92b Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sun, 26 Apr 2009 12:11:09 -0500 Subject: [PATCH] * screen: respect $SCREENRC environment variable, LP: #367250 Signed-off-by: Dustin Kirkland --- debian/changelog | 3 ++- screen | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 022f260b..a97f42b5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,9 @@ screen-profiles (1.51) unreleased; urgency=low * bin/cpu-freq: only print cpu-freq if available * bin/hostname: hostname -s fails sometimes, it seems + * screen: respect $SCREENRC environment variable, LP: #367250 - -- Dustin Kirkland Sat, 25 Apr 2009 10:27:22 -0500 + -- Dustin Kirkland Sun, 26 Apr 2009 12:07:41 -0500 screen-profiles (1.50-0ubuntu1) jaunty; urgency=low diff --git a/screen b/screen index 8ea2cd48..38a958f6 100755 --- a/screen +++ b/screen @@ -20,11 +20,14 @@ # Create the screen-profiles directory, if it doesn't already exist [ -d "$HOME/.screen-profiles" ] || mkdir -p "$HOME/.screen-profiles" -# If $HOME/.screenrc exists but $HOME/.screen-profiles/profile does not, +# Use $SCREENRC if non-empty, and readable; otherwise, use the one in $HOME +[ -n "$SCREENRC" -a -r "$SCREENRC" ] || SCREENRC="$HOME/.screenrc" + +# If $SCREENRC exists but $HOME/.screen-profiles/profile does not, # this shows that the user has an existing custom screen configuration, # and thus we will not force screen-profiles on them. -if [ -r "$HOME/.screenrc" -a ! -e "$HOME/.screen-profiles/profile" -a ! -h "$HOME/.screen-profiles/profile" ]; then - exec /usr/bin/screen.real -c "$HOME/.screenrc" "$@" +if [ -r "$SCREENRC" -a ! -e "$HOME/.screen-profiles/profile" -a ! -h "$HOME/.screen-profiles/profile" ]; then + exec /usr/bin/screen.real -c "$SCREENRC" "$@" exit $? fi @@ -71,8 +74,8 @@ fi # Ensure that their default windows are seeded [ -r "$HOME/.screen-profiles/windows" ] || touch "$HOME/.screen-profiles/windows" -# Ensure that the user's .screenrc at least exists -[ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc" +# Ensure that the user's $SCREENRC at least exists +[ -r "$SCREENRC" ] || touch "$SCREENRC" # Now let's execute screen! if [ -z "$@" ]; then