Browse files

merge upstream

  • Loading branch information...
2 parents 3daf1b1 + c8b9497 commit f1279696899655e42bccf2cbf9eb03f7f539990c @coolwanglu committed Aug 13, 2012
Showing with 27 additions and 22 deletions.
  1. +2 −1 README.mkd
  2. +25 −21 install.sh
View
3 README.mkd
@@ -1,3 +1,4 @@
Based on Sigurd's port to gnome terminal
+========================================
-I created a branch with grayscale base colors
+This is the branch with grayscale base colors.
View
46 install.sh
@@ -35,38 +35,41 @@ done
### Select a profile ###
########################
-typeset -A profiles
-for profile_key in $(gconftool-2 -R $gconfdir | grep $gconfdir | cut -d/ -f5 | cut -d: -f1); do
- profile_name=$(gconftool-2 -g $gconfdir/$profile_key/visible_name)
- profiles[$profile_name]=$profile_key
+declare -a profiles
+declare -a visnames
+profiles=($(gconftool-2 -R $gconfdir | grep $gconfdir | cut -d/ -f5 | cut -d: -f1))
+
+#get visible names
+for index in ${!profiles[@]};
+do
+ visnames[$index]=$(gconftool-2 -g $gconfdir/${profiles[$index]}/visible_name);
done
-
echo "Please select a Gnome Terminal profile:"
-select profile_name in "${!profiles[@]}"; do
- echo
+IFS=','
+names="${visnames[*]}"
+select profile_name in $names;
+do
if [[ -z $profile_name ]]; then
echo -e "ERROR: Invalid selection -- ABORTING!\n"
exit 1
fi
-
- profile_key=${profiles[$profile_name]}
- break
+ break;
done
-
-profile_key=${profiles[$profile_name]}
+profile_key=$(expr ${REPLY} - 1)
+unset IFS
#########################################################
### Show the choices made and prompt for confirmation ###
#########################################################
echo "You have selected:"
echo " Scheme: $scheme"
-echo -e " Profile: $profile_name (gconf key: $profile_key)\n"
+echo -e " Profile: $profile_name (gconf key: ${profiles[$profile_key]})\n"
-typeset -u confirmation
+#typeset -u confirmation
echo -n "Is this correct? (YES to continue) "
read confirmation
-
+confirmation=$(echo $confirmation | tr '[:lower:]' '[:upper:]')
if [[ $confirmation != YES ]]; then
echo -e "ERROR: Confirmation failed -- ABORTING!\n"
exit 3
@@ -78,17 +81,18 @@ fi
echo -e "Confirmation received -- applying settings\n"
+profile_path=$gconfdir/${profiles[$profile_key]}
# set palette
-gconftool-2 -s -t string /apps/gnome-terminal/profiles/$profile_key/palette $(cat $dir/colors/palette)
+gconftool-2 -s -t string $profile_path/palette $(cat $dir/colors/palette)
# set highlighted color to be different from foreground-color
-gconftool-2 -s -t bool /apps/gnome-terminal/profiles/$profile_key/bold_color_same_as_fg false
+gconftool-2 -s -t bool $profile_path/bold_color_same_as_fg false
# set foreground to base00 and background to base3 and highlight color to base01
-gconftool-2 -s -t string /apps/gnome-terminal/profiles/$profile_key/background_color $(cat $bg_color_file)
-gconftool-2 -s -t string /apps/gnome-terminal/profiles/$profile_key/foreground_color $(cat $fg_color_file)
-gconftool-2 -s -t string /apps/gnome-terminal/profiles/$profile_key/bold_color $(cat $bold_color_file)
+gconftool-2 -s -t string $profile_path/background_color $(cat $bg_color_file)
+gconftool-2 -s -t string $profile_path/foreground_color $(cat $fg_color_file)
+gconftool-2 -s -t string $profile_path/bold_color $(cat $bold_color_file)
# make sure the profile is set to not use theme colors
-gconftool-2 -s -t bool /apps/gnome-terminal/profiles/$profile_key/use_theme_colors false
+gconftool-2 -s -t bool $profile_path/use_theme_colors false

0 comments on commit f127969

Please sign in to comment.