* screen: respect $SCREENRC environment variable, LP: #367250

Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
Dustin Kirkland 2009-04-26 12:11:09 -05:00
commit 9303bce623
2 changed files with 10 additions and 6 deletions

3
debian/changelog vendored
View file

@ -2,8 +2,9 @@ screen-profiles (1.51) unreleased; urgency=low
* bin/cpu-freq: only print cpu-freq if available * bin/cpu-freq: only print cpu-freq if available
* bin/hostname: hostname -s fails sometimes, it seems * bin/hostname: hostname -s fails sometimes, it seems
* screen: respect $SCREENRC environment variable, LP: #367250
-- Dustin Kirkland <kirkland@ubuntu.com> Sat, 25 Apr 2009 10:27:22 -0500 -- Dustin Kirkland <kirkland@ubuntu.com> Sun, 26 Apr 2009 12:07:41 -0500
screen-profiles (1.50-0ubuntu1) jaunty; urgency=low screen-profiles (1.50-0ubuntu1) jaunty; urgency=low

13
screen
View file

@ -20,11 +20,14 @@
# Create the screen-profiles directory, if it doesn't already exist # Create the screen-profiles directory, if it doesn't already exist
[ -d "$HOME/.screen-profiles" ] || mkdir -p "$HOME/.screen-profiles" [ -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, # this shows that the user has an existing custom screen configuration,
# and thus we will not force screen-profiles on them. # 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 if [ -r "$SCREENRC" -a ! -e "$HOME/.screen-profiles/profile" -a ! -h "$HOME/.screen-profiles/profile" ]; then
exec /usr/bin/screen.real -c "$HOME/.screenrc" "$@" exec /usr/bin/screen.real -c "$SCREENRC" "$@"
exit $? exit $?
fi fi
@ -71,8 +74,8 @@ fi
# Ensure that their default windows are seeded # Ensure that their default windows are seeded
[ -r "$HOME/.screen-profiles/windows" ] || touch "$HOME/.screen-profiles/windows" [ -r "$HOME/.screen-profiles/windows" ] || touch "$HOME/.screen-profiles/windows"
# Ensure that the user's .screenrc at least exists # Ensure that the user's $SCREENRC at least exists
[ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc" [ -r "$SCREENRC" ] || touch "$SCREENRC"
# Now let's execute screen! # Now let's execute screen!
if [ -z "$@" ]; then if [ -z "$@" ]; then