Drop the distro name in generated profiles

* debian/install: fix installation of profiles
* debian/rules: don't create the ubuntu profile symlink
* debian/screen-profiles-extras.install: no longer need to install
  the distro-specific profiles
* profiles/generate: generate profiles which do not have ubuntu-
  prepended
* select-screen-profile: remove the ubuntu specific profile handling
* screen: fix broken symlinks to ubuntu-* profiles

 -- Dustin Kirkland <kirkland@ubuntu.com>Tue, 21 Apr 2009 14:40:16 -0500
This commit is contained in:
Dustin Kirkland 2009-04-21 14:43:46 -05:00
commit 83aaa105e9
7 changed files with 58 additions and 44 deletions

12
debian/changelog vendored
View file

@ -1,8 +1,16 @@
screen-profiles (1.48) unreleased; urgency=low
* UNRELEASED
Drop the distro name in generated profiles
* debian/install: fix installation of profiles
* debian/rules: don't create the ubuntu profile symlink
* debian/screen-profiles-extras.install: no longer need to install
the distro-specific profiles
* profiles/generate: generate profiles which do not have ubuntu-
prepended
* select-screen-profile: remove the ubuntu specific profile handling
* screen: fix broken symlinks to ubuntu-* profiles
-- Dustin Kirkland <kirkland@ubuntu.com> Sat, 18 Apr 2009 16:13:00 -0500
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 21 Apr 2009 14:40:16 -0500
screen-profiles (1.47-0ubuntu1) jaunty; urgency=low

6
debian/install vendored
View file

@ -2,9 +2,9 @@ bin/* var/lib/screen-profiles
po/locale/* usr/share/locale
profiles/common usr/share/screen-profiles/profiles
profiles/plain usr/share/screen-profiles/profiles
profiles/ubuntu-black usr/share/screen-profiles/profiles
profiles/ubuntu-dark usr/share/screen-profiles/profiles
profiles/ubuntu-light usr/share/screen-profiles/profiles
profiles/black usr/share/screen-profiles/profiles
profiles/dark usr/share/screen-profiles/profiles
profiles/light usr/share/screen-profiles/profiles
keybindings/common usr/share/screen-profiles/keybindings
keybindings/none usr/share/screen-profiles/keybindings
windows/common usr/share/screen-profiles/windows

1
debian/rules vendored
View file

@ -62,7 +62,6 @@ binary-indep: build install
dh_installdebconf -i
dh_compress -i
dh_fixperms -i
dh_link -i /usr/share/${PACKAGE}/profiles/ubuntu-light usr/share/${PACKAGE}/profiles/ubuntu
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i

View file

@ -1,3 +1 @@
profiles/ubuntu-*_* usr/share/screen-profiles/profiles
profiles/*-* usr/share/screen-profiles/profiles/misc
profiles/*_* usr/share/screen-profiles/profiles

View file

@ -19,28 +19,24 @@
# This script should be run during in the './debian/rules get-orig-source'
# step.
DISTROS="ubuntu"
for i in $DISTROS; do
rm -f profiles/$i*
if [ "$1" = "--clean" ]; then
echo "Removing profiles for: $i"
continue
rm -f profiles/light profiles/dark profiles/black profiles/*_*
if [ "$1" = "--clean" ]; then
echo "Removing generated profiles"
exit 0
fi
echo "Generating profiles"
cat profiles/profile.skel > profiles/light
cp profiles/light profiles/dark
sed -i "s/ Wk/ Kw/g" profiles/dark
sed -i "s/kW/wK/g" profiles/dark
for j in "B-light_blue" "b-dark_blue" "C-light_cyan" "c-dark_cyan" "G-light_green" "g-dark_green" "M-light_purple" "m-dark_purple" "R-light_red" "r-dark_red" "Y-light_yellow" "y-dark_yellow" "k-black"; do
x=$(echo "$j" | awk -F"-" '{print $1}')
desc=$(echo "$j" | awk -F"-" '{print $2}')
y="w"
if echo "$desc" | grep -qs "light"; then
y="k"
fi
echo "Generating profiles for: $i"
cat profiles/profile.skel > profiles/$i-light
cp profiles/$i-light profiles/$i-dark
sed -i "s/ Wk/ Kw/g" profiles/$i-dark
sed -i "s/kW/wK/g" profiles/$i-dark
for j in "B-light_blue" "b-dark_blue" "C-light_cyan" "c-dark_cyan" "G-light_green" "g-dark_green" "M-light_purple" "m-dark_purple" "R-light_red" "r-dark_red" "Y-light_yellow" "y-dark_yellow" "k-black"; do
x=$(echo "$j" | awk -F"-" '{print $1}')
desc=$(echo "$j" | awk -F"-" '{print $2}')
y="w"
if echo "$desc" | grep -qs "light"; then
y="k"
fi
cp profiles/$i-light profiles/$i-$desc
sed -i "s/ Wk/ $x$y/g" profiles/$i-$desc
sed -i "s/kW/$y$x/g" profiles/$i-$desc
done
cp profiles/light profiles/$desc
sed -i "s/ Wk/ $x$y/g" profiles/$desc
sed -i "s/kW/$y$x/g" profiles/$desc
done

22
screen
View file

@ -29,8 +29,26 @@ if [ -r "$HOME/.screenrc" -a ! -e "$HOME/.screen-profiles/profile" -a ! -h "$HOM
fi
# Ensure that the user has selected a screen profile
[ -h "$HOME/.screen-profiles/profile" ] || /usr/bin/select-screen-profile
if [ ! -r "$HOME/.screen-profiles/profile" ]; then
profile="$HOME/.screen-profiles/profile"
[ -h "$profile" ] || /usr/bin/select-screen-profile
# Previously, profiles were prepended with ubuntu-.
# This is no longer the case, for cross-distro compatibility.
# Try to fix broken symlinks for upgrading users, or prompt to reselect.
if [ -h "$profile" -a ! -r "$profile" ]; then
if stat "$profile" | head -n1 | grep -qs ".*->.*ubuntu\-.*"; then
newsrc=$(stat "$profile" | head -n1 | sed "s/.*\`//" | sed "s/'.*//" | sed "s/ubuntu-//")
if [ -r "$newsrc" ]; then
ln -sf "$newsrc" "$profile"
else
/usr/bin/select-screen-profile
fi
else
/usr/bin/select-screen-profile
fi
fi
if [ ! -r "$profile" ]; then
echo
echo "Your selected profile is not accessible."
echo

View file

@ -58,19 +58,16 @@ listprofiles() {
# Display list of profiles, one per line
# Start with basic profiles
basename $(ls $PROFILE_DIR/plain 2>/dev/null) 2>/dev/null
basename $(ls $PROFILE_DIR/*-light 2>/dev/null) 2>/dev/null
basename $(ls $PROFILE_DIR/*-dark 2>/dev/null) 2>/dev/null
basename $(ls $PROFILE_DIR/*-black 2>/dev/null) 2>/dev/null
basename $(ls $PROFILE_DIR/light 2>/dev/null) 2>/dev/null
basename $(ls $PROFILE_DIR/dark 2>/dev/null) 2>/dev/null
basename $(ls $PROFILE_DIR/black 2>/dev/null) 2>/dev/null
# Now, list advanced profiles
for x in $(ls $PROFILE_DIR/*-*_* 2>/dev/null); do
for x in $(ls $PROFILE_DIR/*_* 2>/dev/null); do
x=$(basename "$x")
if [ $x = "common" -o $x = "misc" ]; then
# Skip the common profile, no value there
continue
fi
if [ $x = "ubuntu" -a -r "$PROFILE_DIR/ubuntu-light" ]; then
continue
fi
echo "$x"
done
}
@ -84,9 +81,7 @@ prompt() {
for x in $profiles; do
i=$(expr $i + 1)
desc=" "
if [ "$x" = "ubuntu" ]; then
desc="-light\t"
elif [ "$x" = "plain" ]; then
if [ "$x" = "plain" ]; then
simple=$i
fi
[ $i -lt 10 ] && i=" $i"