Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save RichardPovinelli/3925089 to your computer and use it in GitHub Desktop.
Save RichardPovinelli/3925089 to your computer and use it in GitHub Desktop.
Zenburn color scheme for gnome-terminal
#!/usr/bin/env bash
dir=$(dirname $0)
gconfdir=/apps/gnome-terminal/profiles
echo # This makes the prompts easier to follow (as do other random echos below)
########################
### Select a profile ###
########################
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:"
IFS=','
names="${visnames[*]}"
select profile_name in $names;
do
if [[ -z $profile_name ]]; then
echo -e "ERROR: Invalid selection -- ABORTING!\n"
exit 1
fi
break;
done
profile_key=$(expr ${REPLY} - 1)
unset IFS
#########################################################
### Show the choices made and prompt for confirmation ###
#########################################################
echo "You have selected:"
echo -e " Profile: $profile_name (gconf key: ${profiles[$profile_key]})\n"
#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
fi
########################
### Finally... do it ###
########################
echo -e "Confirmation received -- applying settings\n"
profile_path=$gconfdir/${profiles[$profile_key]}
# set palette
gconftool-2 -s -t string $profile_path/palette "#3F3F3F3F3F3F:#CCCC93939393:#7F7F9F9F7F7F:#E3E3CECEABAB:#DFDFAFAF8F8F:#CCCC93939393:#8C8CD0D0D3D3:#DCDCDCDCCCCC:#3F3F3F3F3F3F:#CCCC93939393:#7F7F9F9F7F7F:#E3E3CECEABAB:#DFDFAFAF8F8F:#CCCC93939393:#8C8CD0D0D3D3:#DCDCDCDCCCCC"
# set highlighted color to be different from foreground-color
gconftool-2 -s -t bool $profile_path/bold_color_same_as_fg false
# set foreground, background and highlight color
gconftool-2 -s -t string $profile_path/background_color "#3F3F3F3F3F3F"
gconftool-2 -s -t string $profile_path/foreground_color "#DCDCDCDCCCCC"
gconftool-2 -s -t string $profile_path/bold_color "#000000000000"
# make sure the profile is set to not use theme colors
gconftool-2 -s -t bool $profile_path/use_theme_colors false
# set scroll back to infinity
gconftool-2 -s -t bool $profile_path/scrollback_unlimited true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment