mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 14:03:18 -07:00
Allow local modification of .screenrc (LP: #308216)
This commit is contained in:
parent
dcb2f19aa8
commit
a7a529c273
4 changed files with 25 additions and 6 deletions
5
base-screenrc
Normal file
5
base-screenrc
Normal file
|
@ -0,0 +1,5 @@
|
|||
# This is a base .screenrc file created by the screen-profiles package
|
||||
# The following line sources the currently selected profile
|
||||
source ~/.screenrc-profile
|
||||
|
||||
# Add your personalisation of screen below this line
|
5
debian/changelog
vendored
5
debian/changelog
vendored
|
@ -1,5 +1,8 @@
|
|||
screen-profiles (1.0) jaunty; urgency=low
|
||||
|
||||
[ Dustin Kirklan ]
|
||||
* Initial upload
|
||||
|
||||
[ Nicolas Barcet ]
|
||||
* Allow local modification of .screenrc (LP: #308216)
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Sun, 14 Dec 2008 13:12:12 -0600
|
||||
|
|
1
debian/install
vendored
1
debian/install
vendored
|
@ -5,3 +5,4 @@ bin/updates-available usr/share/screen-profiles/bin
|
|||
profiles/debian.screenrc usr/share/screen-profiles/profiles
|
||||
profiles/ubuntu.screenrc usr/share/screen-profiles/profiles
|
||||
select-screen-profile usr/bin
|
||||
base-screenrc usr/share/screen-profiles
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
PROFILE_DIR="/usr/share/screen-profiles/profiles"
|
||||
BASE_DIR="/usr/share/screen-profiles"
|
||||
PROFILE_DIR="$BASE_DIR/profiles"
|
||||
|
||||
if [ -e "$HOME/.screenrc" ]; then
|
||||
if [ ! -L "$HOME/.screenrc" ]; then
|
||||
echo `gettext 'Error:'` $HOME/.screenrc `gettext 'exists, but is not a symlink'`
|
||||
if [ -e "$HOME/.screenrc-profile" ]; then
|
||||
if [ ! -L "$HOME/.screenrc-profile" ]; then
|
||||
echo `gettext 'Error:'` $HOME/.screenrc-profile `gettext 'exists, but is not a symlink'`
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
@ -40,7 +41,16 @@ i=0
|
|||
for x in $profiles; do
|
||||
i=`expr $i + 1`
|
||||
if [ $i -eq $selected ]; then
|
||||
rm -f "$HOME/.screenrc" && ln -s "$PROFILE_DIR/$x" "$HOME/.screenrc"
|
||||
# avoid overriding a user's existing .screenrc
|
||||
if [ ! -e "$HOME/.screenrc" ]; then
|
||||
cp "$BASE_DIR/base-screenrc" "$HOME/.screenrc" && \
|
||||
chown "$USER" "$HOME/.screenrc"
|
||||
else
|
||||
echo "You already have a ~/.screenrc file. Make sure that it contains"
|
||||
echo "a line with 'source ~/.screenrc-profile' to make use of you new"
|
||||
echo "profile."
|
||||
fi
|
||||
rm -f "$HOME/.screenrc-profile" && ln -s "$PROFILE_DIR/$x" "$HOME/.screenrc-profile"
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue