Skip to content

Instantly share code, notes, and snippets.

@overengineer
Last active November 21, 2024 08:45
Show Gist options
  • Save overengineer/e42a889586c1f8a45599fc1fc444e1e0 to your computer and use it in GitHub Desktop.
Save overengineer/e42a889586c1f8a45599fc1fc444e1e0 to your computer and use it in GitHub Desktop.
One Dark Pro Monokai Darker Gnome Terminal Theme

One Dark Pro Monokai Darker Gnome Terminal Theme

Export Gnome Terminal Profile

List profiles

dconf dump /org/gnome/terminal/legacy/profiles:/

Determine the terminal profile string for the profile you will need. This is the terminal profile that I will export:

[:483de6af-c348-4396-909d-5ee5490990e6]
background-color='rgb(18,18,18)'
bold-is-bright=true
cursor-background-color='rgb(248,248,240)'
cursor-colors-set=true
cursor-foreground-color='rgb(18,18,18)'
cursor-shape='ibeam'
highlight-background-color='rgb(40,42,49)'
highlight-colors-set=true
highlight-foreground-color='rgb(215,218,224)'
palette=['rgb(92,99,112)', 'rgb(244,71,71)', 'rgb(152,195,121)', 'rgb(205,151,49)', 'rgb(103,150,230)', 'rgb(178,103,230)', 'rgb(86,182,194)', 'rgb(171,178,191)', 'rgb(117,113,94)', 'rgb(224,108,117)', 'rgb(138,226,52)', 'rgb(229,192,123)', 'rgb(97,175,239)', 'rgb(198,120,221)', 'rgb(52,226,226)', 'rgb(248,248,240)']
scroll-on-output=true
use-theme-colors=false
visible-name='One Dark Pro Monokai Darker'

And the string that I will need to use to export is

:483de6af-c348-4396-909d-5ee5490990e6

The command to export that profile is (note the ending slash)

dconf dump /org/gnome/terminal/legacy/profiles:/:483de6af-c348-4396-909d-5ee5490990e6/ > one-dark-pro-monokai-darker-theme-profile.dconf

To restore the profile

dconf load /org/gnome/terminal/legacy/profiles:/:483de6af-c348-4396-909d-5ee5490990e6/ < one-dark-pro-monokai-darker-theme-profile.dconf

Credits

#!/bin/sh
# usage: cat "source OneDarkProMonokaiDarker.sh" >> ~/.bashrc
if [ "${TERM%%-*}" = 'linux' ]; then
# This script doesn't support linux console (use 'vconsole' template instead)
return 2>/dev/null || exit 0
fi
color00="5c/63/70"
color01="f4/47/47"
color02="98/c3/79"
color03="cd/96/31"
color04="67/96/e6"
color05="b1/67/e6"
color06="56/b5/c2"
color07="ab/b2/bf"
color08="75/71/5e"
color09="e0/6c/76"
color10="8b/e2/34"
color11="e5/c0/7b"
color12="61/af/ef"
color13="c6/78/dd"
color14="34/e2/e2"
color15="f8/f8/f0"
color16="fd/8b/19" # Base 09
color17="b3/35/08" # Base 0F
color18="43/3b/42" # Base 01
color19="5c/54/5b" # Base 02
color20="98/94/98" # Base 04
color21="d5/d3/d5" # Base 06
color_foreground="f8/f8/f0" # Base 05
color_background="12/12/12" # Base 00
color_cursor="b9/b5/b8" # Base 05
if [ -n "$TMUX" ]; then
# tell tmux to pass the escape sequences through
# (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324)
printf_template="\033Ptmux;\033\033]4;%d;rgb:%s\007\033\\"
printf_template_var="\033Ptmux;\033\033]%d;rgb:%s\007\033\\"
printf_template_custom="\033Ptmux;\033\033]%s%s\007\033\\"
elif [ "${TERM%%-*}" = "screen" ]; then
# GNU screen (screen, screen-256color, screen-256color-bce)
printf_template="\033P\033]4;%d;rgb:%s\007\033\\"
printf_template_var="\033P\033]%d;rgb:%s\007\033\\"
printf_template_custom="\033P\033]%s%s\007\033\\"
else
printf_template="\033]4;%d;rgb:%s\033\\"
printf_template_var="\033]%d;rgb:%s\033\\"
printf_template_custom="\033]%s%s\033\\"
fi
# 16 color space
printf $printf_template 0 $color00
printf $printf_template 1 $color01
printf $printf_template 2 $color02
printf $printf_template 3 $color03
printf $printf_template 4 $color04
printf $printf_template 5 $color05
printf $printf_template 6 $color06
printf $printf_template 7 $color07
printf $printf_template 8 $color08
printf $printf_template 9 $color09
printf $printf_template 10 $color10
printf $printf_template 11 $color11
printf $printf_template 12 $color12
printf $printf_template 13 $color13
printf $printf_template 14 $color14
printf $printf_template 15 $color15
# 256 color space
printf $printf_template 16 $color16
printf $printf_template 17 $color17
printf $printf_template 18 $color18
printf $printf_template 19 $color19
printf $printf_template 20 $color20
printf $printf_template 21 $color21
# foreground / background / cursor color
if [ -n "$ITERM_SESSION_ID" ]; then
# iTerm2 proprietary escape codes
printf $printf_template_custom Pg b9b5b8 # forground
printf $printf_template_custom Ph 322931 # background
printf $printf_template_custom Pi b9b5b8 # bold color
printf $printf_template_custom Pj 5c545b # selection color
printf $printf_template_custom Pk b9b5b8 # selected text color
printf $printf_template_custom Pl b9b5b8 # cursor
printf $printf_template_custom Pm 322931 # cursor text
else
printf $printf_template_var 10 $color_foreground
printf $printf_template_var 11 $color_background
printf $printf_template_var 12 $color_cursor
fi
# clean up
unset printf_template
unset printf_template_var
unset color00
unset color01
unset color02
unset color03
unset color04
unset color05
unset color06
unset color07
unset color08
unset color09
unset color10
unset color11
unset color12
unset color13
unset color14
unset color15
unset color16
unset color17
unset color18
unset color19
unset color20
unset color21
unset color_foreground
unset color_background
unset color_cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment