Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixing gnome terminal template for ubuntu 14.04

  • Loading branch information...
commit b854cea70db453207636095fce82e26a77582941 1 parent bbba907
@JBKahn JBKahn authored
View
125 templates/gnome-terminal/dark.sh.erb
@@ -12,67 +12,71 @@
[[ -z "$UUIDGEN" ]] && UUIDGEN=uuidgen
dset() {
- local key="$1"; shift
- local val="$1"; shift
+ local key="$1"; shift
+ local val="$1"; shift
- if [[ "$type" == "string" ]]; then
- val="'$val'"
- fi
+ if [[ "$type" == "string" ]]; then
+ val="'$val'"
+ fi
- "$DCONF" write "$PROFILE_KEY/$key" "$val"
+ "$DCONF" write "$PROFILE_KEY/$key" "$val"
}
# because dconf still doesn't have "append"
dlist_append() {
- local key="$1"; shift
- local val="$1"; shift
+ local key="$1"; shift
+ local val="$1"; shift
- local entries="$(
- {
- "$DCONF" read "$key" | tr -d '[]' | tr , "\n" | fgrep -v "$val"
- echo "'$val'"
- } | head -c-1 | tr "\n" ,
- )"
+ local entries="$(
+ {
+ "$DCONF" read "$key" | tr -d '[]' | tr , "\n" | fgrep -v "$val"
+ echo "'$val'"
+ } | head -c-1 | tr "\n" ,
+ )"
- "$DCONF" write "$key" "[$entries]"
+ "$DCONF" write "$key" "[$entries]"
}
# Newest versions of gnome-terminal use dconf
if which "$DCONF" > /dev/null 2>&1; then
- [[ -z "$BASE_KEY" ]] && BASE_KEY=/org/gnome/terminal/legacy/profiles:
+ [[ -z "$BASE_KEY_NEW" ]] && BASE_KEY_NEW=/org/gnome/terminal/legacy/profiles:
- if [[ -n "`$DCONF list $BASE_KEY/`" ]]; then
- if which "$UUIDGEN" > /dev/null 2>&1; then
- PROFILE_SLUG=`uuidgen`
- fi
+ if [[ -n "`$DCONF list $BASE_KEY_NEW/`" ]]; then
+ if which "$UUIDGEN" > /dev/null 2>&1; then
+ PROFILE_SLUG=`uuidgen`
+ fi
- if [[ -n "`$DCONF read $BASE_KEY/default`" ]]; then
- DEFAULT_SLUG=`$DCONF read $BASE_KEY/default | tr -d \'`
- else
- DEFAULT_SLUG=`$DCONF list $BASE_KEY/ | grep '^:' | head -n1 | tr -d :/`
- fi
+ if [[ -n "`$DCONF read $BASE_KEY_NEW/default`" ]]; then
+ DEFAULT_SLUG=`$DCONF read $BASE_KEY_NEW/default | tr -d \'`
+ else
+ DEFAULT_SLUG=`$DCONF list $BASE_KEY_NEW/ | grep '^:' | head -n1 | tr -d :/`
+ fi
- DEFAULT_KEY="$BASE_KEY/:$DEFAULT_SLUG"
- PROFILE_KEY="$BASE_KEY/:$PROFILE_SLUG"
+ DEFAULT_KEY="$BASE_KEY_NEW/:$DEFAULT_SLUG"
+ PROFILE_KEY="$BASE_KEY_NEW/:$PROFILE_SLUG"
- # copy existing settings from default profile
- $DCONF dump "$DEFAULT_KEY/" | $DCONF load "$PROFILE_KEY/"
+ # copy existing settings from default profile
+ $DCONF dump "$DEFAULT_KEY/" | $DCONF load "$PROFILE_KEY/"
- # add new copy to list of profiles
- dlist_append $BASE_KEY/list "$PROFILE_SLUG"
+ # add new copy to list of profiles
+ dlist_append $BASE_KEY_NEW/list "$PROFILE_SLUG"
- # update profile values with theme options
- dset visible-name "'$PROFILE_NAME'"
+ # update profile values with theme options
+ dset visible-name "'$PROFILE_NAME'"
dset palette "['#<%= @base["00"]["hex"] %>', '#<%= @base["08"]["hex"] %>', '#<%= @base["0B"]["hex"] %>', '#<%= @base["0A"]["hex"] %>', '#<%= @base["0D"]["hex"] %>', '#<%= @base["0E"]["hex"] %>', '#<%= @base["0C"]["hex"] %>', '#<%= @base["05"]["hex"] %>', '#<%= @base["03"]["hex"] %>', '#<%= @base["08"]["hex"] %>', '#<%= @base["0B"]["hex"] %>', '#<%= @base["0A"]["hex"] %>', '#<%= @base["0D"]["hex"] %>', '#<%= @base["0E"]["hex"] %>', '#<%= @base["0C"]["hex"] %>', '#<%= @base["07"]["hex"] %>']"
- dset background-color "'#<%= @base["00"]["hex"] %>'"
- dset foreground-color "'#<%= @base["05"]["hex"] %>'"
- dset bold-color "'#<%= @base["05"]["hex"] %>'"
- dset bold-color-same-as-fg "true"
- dset use-theme-colors "false"
- dset use-theme-background "false"
-
- exit 0
- fi
+ dset background-color "'#<%= @base["00"]["hex"] %>'"
+ dset foreground-color "'#<%= @base["05"]["hex"] %>'"
+ dset bold-color "'#<%= @base["05"]["hex"] %>'"
+ dset bold-color-same-as-fg "true"
+ dset use-theme-colors "false"
+ dset use-theme-background "false"
+
+ unset PROFILE_NAME
+ unset PROFILE_SLUG
+ unset DCONF
+ unset UUIDGEN
+ exit 0
+ fi
fi
# Fallback for Gnome 2 and early Gnome 3
@@ -82,27 +86,27 @@ fi
PROFILE_KEY="$BASE_KEY/$PROFILE_SLUG"
gset() {
- local type="$1"; shift
- local key="$1"; shift
- local val="$1"; shift
+ local type="$1"; shift
+ local key="$1"; shift
+ local val="$1"; shift
- "$GCONFTOOL" --set --type "$type" "$PROFILE_KEY/$key" -- "$val"
+ "$GCONFTOOL" --set --type "$type" "$PROFILE_KEY/$key" -- "$val"
}
# Because gconftool doesn't have "append"
glist_append() {
- local type="$1"; shift
- local key="$1"; shift
- local val="$1"; shift
-
- local entries="$(
- {
- "$GCONFTOOL" --get "$key" | tr -d '[]' | tr , "\n" | fgrep -v "$val"
- echo "$val"
- } | head -c-1 | tr "\n" ,
- )"
-
- "$GCONFTOOL" --set --type list --list-type $type "$key" "[$entries]"
+ local type="$1"; shift
+ local key="$1"; shift
+ local val="$1"; shift
+
+ local entries="$(
+ {
+ "$GCONFTOOL" --get "$key" | tr -d '[]' | tr , "\n" | fgrep -v "$val"
+ echo "$val"
+ } | head -c-1 | tr "\n" ,
+ )"
+
+ "$GCONFTOOL" --set --type list --list-type $type "$key" "[$entries]"
}
# Append the Base16 profile to the profile list
@@ -116,3 +120,8 @@ gset string bold_color "#<%= @base["05"]["hex"] %>"
gset bool bold_color_same_as_fg "true"
gset bool use_theme_colors "false"
gset bool use_theme_background "false"
+
+unset PROFILE_NAME
+unset PROFILE_SLUG
+unset DCONF
+unset UUIDGEN
View
125 templates/gnome-terminal/light.sh.erb
@@ -12,68 +12,72 @@
[[ -z "$UUIDGEN" ]] && UUIDGEN=uuidgen
dset() {
- local key="$1"; shift
- local val="$1"; shift
+ local key="$1"; shift
+ local val="$1"; shift
- if [[ "$type" == "string" ]]; then
- val="'$val'"
- fi
+ if [[ "$type" == "string" ]]; then
+ val="'$val'"
+ fi
- "$DCONF" write "$PROFILE_KEY/$key" "$val"
+ "$DCONF" write "$PROFILE_KEY/$key" "$val"
}
# because dconf still doesn't have "append"
dlist_append() {
- local key="$1"; shift
- local val="$1"; shift
+ local key="$1"; shift
+ local val="$1"; shift
- local entries="$(
- {
- "$DCONF" read "$key" | tr -d '[]' | tr , "\n" | fgrep -v "$val"
- echo "'$val'"
- } | head -c-1 | tr "\n" ,
- )"
+ local entries="$(
+ {
+ "$DCONF" read "$key" | tr -d '[]' | tr , "\n" | fgrep -v "$val"
+ echo "'$val'"
+ } | head -c-1 | tr "\n" ,
+ )"
- "$DCONF" write "$key" "[$entries]"
+ "$DCONF" write "$key" "[$entries]"
}
# Newest versions of gnome-terminal use dconf
if which "$DCONF" > /dev/null 2>&1; then
- [[ -z "$BASE_KEY" ]] && BASE_KEY=/org/gnome/terminal/legacy/profiles:
+ [[ -z "$BASE_KEY_NEW" ]] && BASE_KEY_NEW=/org/gnome/terminal/legacy/profiles:
- if [[ -n "`$DCONF list $BASE_KEY/`" ]]; then
- if which "$UUIDGEN" > /dev/null 2>&1; then
- PROFILE_SLUG=`uuidgen`
- fi
+ if [[ -n "`$DCONF list $BASE_KEY_NEW/`" ]]; then
+ if which "$UUIDGEN" > /dev/null 2>&1; then
+ PROFILE_SLUG=`uuidgen`
+ fi
- if [[ -n "`$DCONF read $BASE_KEY/default`" ]]; then
- DEFAULT_SLUG=`$DCONF read $BASE_KEY/default | tr -d \'`
- else
- DEFAULT_SLUG=`$DCONF list $BASE_KEY/ | grep '^:' | head -n1 | tr -d :/`
- fi
+ if [[ -n "`$DCONF read $BASE_KEY_NEW/default`" ]]; then
+ DEFAULT_SLUG=`$DCONF read $BASE_KEY_NEW/default | tr -d \'`
+ else
+ DEFAULT_SLUG=`$DCONF list $BASE_KEY_NEW/ | grep '^:' | head -n1 | tr -d :/`
+ fi
- DEFAULT_KEY="$BASE_KEY/:$DEFAULT_SLUG"
- PROFILE_KEY="$BASE_KEY/:$PROFILE_SLUG"
+ DEFAULT_KEY="$BASE_KEY_NEW/:$DEFAULT_SLUG"
+ PROFILE_KEY="$BASE_KEY_NEW/:$PROFILE_SLUG"
- # copy existing settings from default profile
- $DCONF dump "$DEFAULT_KEY/" | $DCONF load "$PROFILE_KEY/"
+ # copy existing settings from default profile
+ $DCONF dump "$DEFAULT_KEY/" | $DCONF load "$PROFILE_KEY/"
- # add new copy to list of profiles
- dlist_append $BASE_KEY/list "$PROFILE_SLUG"
+ # add new copy to list of profiles
+ dlist_append $BASE_KEY_NEW/list "$PROFILE_SLUG"
- # update profile values with theme options
- dset visible-name "'$PROFILE_NAME'"
+ # update profile values with theme options
+ dset visible-name "'$PROFILE_NAME'"
dset palette "'#<%= @base["00"]["hex"] %>:#<%= @base["08"]["hex"] %>:#<%= @base["0B"]["hex"] %>:#<%= @base["0A"]["hex"] %>:#<%= @base["0D"]["hex"] %>:#<%= @base["0E"]["hex"] %>:#<%= @base["0C"]["hex"] %>:#<%= @base["05"]["hex"] %>:#<%= @base["03"]["hex"] %>:#<%= @base["08"]["hex"] %>:#<%= @base["0B"]["hex"] %>:#<%= @base["0A"]["hex"] %>:#<%= @base["0D"]["hex"] %>:#<%= @base["0E"]["hex"] %>:#<%= @base["0C"]["hex"] %>:#<%= @base["07"]["hex"] %>'"
dset palette "'#<%= @base["07"]["hex"] %>:#<%= @base["08"]["hex"] %>:#<%= @base["0B"]["hex"] %>:#<%= @base["0A"]["hex"] %>:#<%= @base["0D"]["hex"] %>:#<%= @base["0E"]["hex"] %>:#<%= @base["0C"]["hex"] %>:#<%= @base["05"]["hex"] %>:#<%= @base["03"]["hex"] %>:#<%= @base["08"]["hex"] %>:#<%= @base["0B"]["hex"] %>:#<%= @base["0A"]["hex"] %>:#<%= @base["0D"]["hex"] %>:#<%= @base["0E"]["hex"] %>:#<%= @base["0C"]["hex"] %>:#<%= @base["00"]["hex"] %>'"
- dset background-color "'#<%= @base["07"]["hex"] %>'"
- dset foreground-color "'#<%= @base["02"]["hex"] %>'"
- dset bold-color "'#<%= @base["02"]["hex"] %>'"
- dset bold-color-same-as-fg "true"
- dset use-theme-colors "false"
- dset use-theme-background "false"
-
- exit 0
- fi
+ dset background-color "'#<%= @base["07"]["hex"] %>'"
+ dset foreground-color "'#<%= @base["02"]["hex"] %>'"
+ dset bold-color "'#<%= @base["02"]["hex"] %>'"
+ dset bold-color-same-as-fg "true"
+ dset use-theme-colors "false"
+ dset use-theme-background "false"
+
+ unset PROFILE_NAME
+ unset PROFILE_SLUG
+ unset DCONF
+ unset UUIDGEN
+ exit 0
+ fi
fi
# Fallback for Gnome 2 and early Gnome 3
@@ -83,27 +87,27 @@ fi
PROFILE_KEY="$BASE_KEY/$PROFILE_SLUG"
gset() {
- local type="$1"; shift
- local key="$1"; shift
- local val="$1"; shift
+ local type="$1"; shift
+ local key="$1"; shift
+ local val="$1"; shift
- "$GCONFTOOL" --set --type "$type" "$PROFILE_KEY/$key" -- "$val"
+ "$GCONFTOOL" --set --type "$type" "$PROFILE_KEY/$key" -- "$val"
}
# Because gconftool doesn't have "append"
glist_append() {
- local type="$1"; shift
- local key="$1"; shift
- local val="$1"; shift
-
- local entries="$(
- {
- "$GCONFTOOL" --get "$key" | tr -d '[]' | tr , "\n" | fgrep -v "$val"
- echo "$val"
- } | head -c-1 | tr "\n" ,
- )"
-
- "$GCONFTOOL" --set --type list --list-type $type "$key" "[$entries]"
+ local type="$1"; shift
+ local key="$1"; shift
+ local val="$1"; shift
+
+ local entries="$(
+ {
+ "$GCONFTOOL" --get "$key" | tr -d '[]' | tr , "\n" | fgrep -v "$val"
+ echo "$val"
+ } | head -c-1 | tr "\n" ,
+ )"
+
+ "$GCONFTOOL" --set --type list --list-type $type "$key" "[$entries]"
}
# Append the Base16 profile to the profile list
@@ -117,3 +121,8 @@ gset string bold_color "#<%= @base["02"]["hex"] %>"
gset bool bold_color_same_as_fg "true"
gset bool use_theme_colors "false"
gset bool use_theme_background "false"
+
+unset PROFILE_NAME
+unset PROFILE_SLUG
+unset DCONF
+unset UUIDGEN
Please sign in to comment.
Something went wrong with that request. Please try again.