[
  {
    "path": "LICENSE.mkd",
    "content": "License\n=======\n\nCopyright (c) 2011 Sigurd Gartmann\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"
  },
  {
    "path": "README.mkd",
    "content": "Colorschemes for Gnome Terminal\n========================================\n\nScripts for setting various colorschemes with Gnome Terminal. To get nicely\ncolored directory listings, you will also need to set up a [dircolors solarised\ncolor theme].\n\nFor Mate Terminal, you can use [mate-terminal-colors-solarized], maintained\nby @cledoux.\n\nColorschemes\n------------\n\n[Dracula][dracula]:\n\n![Dracula](/screenshots/dracula.png?raw=true \"Dracula\")\n\n[Gotham][vim-gotham]:\n\n![Gotham](/screenshots/gotham.png?raw=true \"Gotham\")\n\n[Hemisu][vim-hemisu] dark:\n\n![Hemisu (dark)](/screenshots/hemisu-dark.png?raw=true \"Hemisu (dark)\")\n\n[Hemisu][vim-hemisu] light:\n\n![Hemisu (light)](/screenshots/hemisu-light.png?raw=true \"Hemisu (light)\")\n\n[Solarized][Solarized homepage] dark:\n\n![Solarized (dark)](/screenshots/solarized-dark.png?raw=true \"Solarized (dark)\")\n\n[Solarized][Solarized homepage] dark (alternative):\n\n![Solarized (dark alternative)](/screenshots/solarized-dark-alternative.png?raw=true \"Solarized (dark alternative)\")\n\n[Solarized][Solarized homepage] light:\n\n![Solarized (light)](/screenshots/solarized-light.png?raw=true \"Solarized (light)\")\n\nPreviews\n--------\n\n[Hemisu][vim-hemisu] dark:\n\n![Hemisu (dark)](/screenshots/hemisu-dark.png?raw=true \"Hemisu (dark)\")\n\n[Hemisu][vim-hemisu] light:\n\n![Hemisu (light)](/screenshots/hemisu-light.png?raw=true \"Hemisu (light)\")\n\n[Solarized][Solarized homepage] dark:\n\n![Solarized (dark)](/screenshots/solarized-dark.png?raw=true \"Solarized (dark)\")\n\n[Solarized][Solarized homepage] dark (alternative):\n\n![Solarized (dark alternative)](/screenshots/solarized-dark-alternative.png?raw=true \"Solarized (dark alternative)\")\n\n[Solarized][Solarized homepage] light:\n\n![Solarized (light)](/screenshots/solarized-light.png?raw=true \"Solarized (light)\")\n\nInstallation and usage\n----------------------\n\nTo be able to uninstall, we highly recommend that you create a new Gnome\nTerminal profile, using the menus in Gnome Terminal (File... New Profile).\n\nYou need the `dconf` command (if you run a recent Gnome version). With Ubuntu,\nthis can be installed by running\n\n    $ sudo apt-get install dconf-cli\n\nThen clone the repository and you can run the installation script:\n\n    $ git clone https://github.com/metalelf0/gnome-terminal-colors.git\n    $ cd gnome-terminal-colors-solarized\n    $ ./install.sh\n\nAnd just follow the instructions.\n\nTo run this script remotely or via cron (or from any shell where\n`DBUS_SESSION_BUS_ADDRESS` is not set), you need to start a dbus connection:\n\n    $ dbus-launch ./install.sh\n\nUninstall\n---------\n\nChange to another profile in Gnome Terminal, then remove the Solarized profile\nby running:\n\n### Gnome 3.6 or lower\n\n    $ rm -r ~/.gconf/apps/gnome-terminal/profiles/Solarized/\n    $ gconftool-2 --recursive-unset /apps/gnome-terminal\n\n### Gnome 3.8 or higher\n\nBe sure to have the dconf-cli package installed and do:\n\n    $ dconf reset -f /org/gnome/terminal/legacy/profiles:/PROFILE_ID\"\n\nReplace PROFILE_ID by your profile ID (you can get it in your profile\nconfiguration in gnome-terminal).\n\nThemes\n------\n\nEach theme has is own folder in the `colors` dir. It contains the following\nfiles:\n\n  * bd_color: bold color\n  * bg_color: background color\n  * fg_color: foreground color\n  * palette: list of colors for all standard color codes.\n\nNo additional configuration is needed to add a theme, the installation script\njust list at launch the children folders in the `colors` dir.\n\nDircolors\n---------\n\nThe installation script will ask if a solarized dircolors is wanted. It will be\ndownloaded and installed as `~/.dir_colors/dircolors`. On CentOS, it can be an\nissue (see issue #62), as the default setup use `~/.dir_colors` as dircolors.\nIn that case, you should manually move `~/.dir_colors` as\n`~/.dir_colors/dircolors` before starting the installation script.\n\nIf the dircolors is not applied, please check that your shell actually source\nyour dircolors:\n```\nif [ -f ~/.dir_colors/dircolors ]\n    then eval `dircolors ~/.dir_colors/dircolors`\nfi\n```\n\nThis should not be necessary on major distributions (such as Ubuntu, Fedora,\netc.) but could be on ArchLinux, Gentoo and others.\n\nImporting iTerm themes\n----------------------\n\nIt's possible to import an iTerm colorscheme to a gnome-terminal one. Use the\nscript `tools/import_from_iterm.rb`.\n\nPrerequisites: a working ruby installation with the `nokogiri-plist` ruby gem\n(`gem install nokogiri-plist`).\n\nExample call:\n\n`tools/import_from_iterm.rb my_iterm_colorscheme.itermcolors my_iterm_colorscheme`\n\nContributors\n------------\n\nThe original [Gnome Terminal Colors Solarized repository] project:\n\n* Sigurd Gartmann <sigurdga@sigurdga.no>\n* Anthony Ruhier <anthony.ruhier@gmail.com>\n* Paul Thomson <captbunzo@gmail.com>\n* Techlive Zheng <techlivezheng@gmail.com>\n* Daniel Graña <dangra@gmail.com>\n\n Colorscheme authors\n -------------------\n\n * [Solarized][Solarized homepage]: Ethan Schoonover\n * [Gotham][vim-gotham]: Andrea Leopardi\n * [Hemisu][vim-hemisu]: Noah Frederick\n\n Solarized\n ===\n\n Colors\n ------\n\n Only the foreground, background and highlight colors are different in the light\n and dark color sets, as one of the main ideas behind Ethan Schonoovers work is\n to use the same colors in the palette for both.\n\n See the [Solarized homepage] for theory behind the colors, screenshots, details\n and colorscheme versions for Vim, Mutt, popular terminal emulators and other\n applications.\n\n For the original works of Ethan Schoonover, visit the [Solarized repository].\n The scripts for Gnome Terminal is maintained in [Gnome Terminal Colors\n Solarized repository].\n\nColorscheme authors\n-------------------\n\n* [Solarized][Solarized homepage]: Ethan Schoonover\n* [Gotham][vim-gotham]: Andrea Leopardi\n* [Hemisu][vim-hemisu]: Noah Frederick\n* [Dracula][dracula]: Zeno Rocha\n\nSolarized\n===\n\nColors\n------\n\nOnly the foreground, background and highlight colors are different in the light\nand dark color sets, as one of the main ideas behind Ethan Schonoovers work is\nto use the same colors in the palette for both.\n\nSee the [Solarized homepage] for theory behind the colors, screenshots, details\nand colorscheme versions for Vim, Mutt, popular terminal emulators and other\napplications.\n\nFor the original works of Ethan Schoonover, visit the [Solarized repository].\nThe scripts for Gnome Terminal is maintained in [Gnome Terminal Colors\nSolarized repository].\n\nFAQ\n===\n\nConflicting background colors in VIM\n------------------------------------\n\nUse the 16 colors terminal option to get VIM to look like GVIM with solarized\ncolors.\n\n    set t_Co=16\n\n\n[mate-terminal-colors-solarized]: https://github.com/cledoux/mate-terminal-colors-solarized\n[Solarized homepage]:   http://ethanschoonover.com/solarized\n[Solarized repository]: https://github.com/altercation/solarized\n[Gnome Terminal Colors Solarized repository]: https://github.com/sigurdga/gnome-terminal-colors-solarized\n[dircolors solarised color theme]: https://github.com/seebi/dircolors-solarized\n[Gotham]\n[vim-gotham]: https://github.com/whatyouhide/vim-gotham\n[vim-hemisu]: https://github.com/noahfrederick/vim-hemisu\n[dracula]:    https://github.com/zenorocha/dracula-theme\n"
  },
  {
    "path": "colors/challenger-deep/bd_color",
    "content": "#cbe3e7\n"
  },
  {
    "path": "colors/challenger-deep/bg_color",
    "content": "#1b182c\n"
  },
  {
    "path": "colors/challenger-deep/fg_color",
    "content": "#cbe3e7\n"
  },
  {
    "path": "colors/challenger-deep/palette",
    "content": "#565575\n#ff8080\n#95ffa4\n#ffe9aa\n#91ddff\n#c991e1\n#aaffe4\n#cbe3e7\n#100e23\n#ff5458\n#62d196\n#ffb378\n#65b2ff\n#906cff\n#63f2f1\n#a6b3cc\n"
  },
  {
    "path": "colors/dark/palette",
    "content": "#070736364242\n#DCDC32322F2F\n#858599990000\n#B5B589890000\n#26268B8BD2D2\n#D3D336368282\n#2A2AA1A19898\n#EEEEE8E8D5D5\n#00002B2B3636\n#CBCB4B4B1616\n#58586E6E7575\n#65657B7B8383\n#838394949696\n#6C6C7171C4C4\n#9393A1A1A1A1\n#FDFDF6F6E3E3\n"
  },
  {
    "path": "colors/dark_alternative/palette",
    "content": "#00002B2B3636\n#CBCB4B4B1616\n#58586E6E7575\n#65657B7B8383\n#838394949696\n#6C6C7171C4C4\n#9393A1A1A1A1\n#FDFDF6F6E3E3\n#070736364242\n#DCDC32322F2F\n#858599990000\n#B5B589890000\n#26268B8BD2D2\n#D3D336368282\n#2A2AA1A19898\n#EEEEE8E8D5D5\n"
  },
  {
    "path": "colors/dracula/README.md",
    "content": "Colorscheme dracula - imported from iterm on 2015-04-08 10:33:45 +0200\n"
  },
  {
    "path": "colors/dracula/bd_color",
    "content": "#ffffffffffff\n"
  },
  {
    "path": "colors/dracula/bg_color",
    "content": "#1e1f1f4528e7\n"
  },
  {
    "path": "colors/dracula/fg_color",
    "content": "#f8f8f8f8f2f2\n"
  },
  {
    "path": "colors/dracula/palette",
    "content": "#000000000000\n#ffff55555555\n#5050fafa7b7b\n#f1f1fafa8c8c\n#bdbd9393f9f9\n#ffff7979c6c6\n#8b8be9e9fdfd\n#bbbbbbbbbbbb\n#555555555555\n#ffff55555555\n#5050fafa7b7b\n#f1f1fafa8c8c\n#bdbd9393f9f9\n#ffff7979c6c6\n#8b8be9e9fdfd\n#ffffffffffff\n"
  },
  {
    "path": "colors/gotham/README",
    "content": "# Gotham colorscheme\n\nhttps://github.com/whatyouhide/vim-gotham\nhttps://github.com/whatyouhide/gotham-contrib\n"
  },
  {
    "path": "colors/gotham/bd_color",
    "content": "#9898d1d1cece\n"
  },
  {
    "path": "colors/gotham/bg_color",
    "content": "#0a0a0f0f1414\n"
  },
  {
    "path": "colors/gotham/fg_color",
    "content": "#9898d1d1cece\n"
  },
  {
    "path": "colors/gotham/palette",
    "content": "#0a0a0f0f1414\n#c3c330302727\n#2626a9a98b8b\n#ededb5b54b4b\n#191954546565\n#4e4e51516565\n#333385859d9d\n#9898d1d1cece\n#101015151b1b\n#d2d269693939\n#08081f1f2d2d\n#242453536161\n#090937374848\n#88888b8ba5a5\n#59599c9caaaa\n#d3d3ebebe9e9\n"
  },
  {
    "path": "colors/gruvbox-dark/README.md",
    "content": "Colorscheme gruvbox-dark - imported from iterm on 2015-06-09 14:46:18 +0200\n"
  },
  {
    "path": "colors/gruvbox-dark/bd_color",
    "content": "#000000000000\n"
  },
  {
    "path": "colors/gruvbox-dark/bg_color",
    "content": "#282828282828\n"
  },
  {
    "path": "colors/gruvbox-dark/fg_color",
    "content": "#ebebdbdbb2b2\n"
  },
  {
    "path": "colors/gruvbox-dark/palette",
    "content": "#282828282828\n#cccc24241d1d\n#989897971a1a\n#d7d799992121\n#454585858888\n#b1b162628686\n#68689d9d6a6a\n#bdbdaeae9393\n#7c7c6f6f6464\n#fbfb49493434\n#b8b8bbbb2626\n#fafabdbd2f2f\n#8383a5a59898\n#d3d386869b9b\n#8e8ec0c07c7c\n#ebebdbdbb2b2\n"
  },
  {
    "path": "colors/gruvbox-light/README.md",
    "content": "Colorscheme gruvbox-light - imported from iterm on 2015-06-09 14:46:31 +0200\n"
  },
  {
    "path": "colors/gruvbox-light/bd_color",
    "content": "#000000000000\n"
  },
  {
    "path": "colors/gruvbox-light/bg_color",
    "content": "#fdfdf4f4c1c1\n"
  },
  {
    "path": "colors/gruvbox-light/fg_color",
    "content": "#3c3c38383636\n"
  },
  {
    "path": "colors/gruvbox-light/palette",
    "content": "#fdfdf4f4c1c1\n#cccc24241d1d\n#989897971a1a\n#d7d799992121\n#454585858888\n#b1b162628686\n#68689d9d6a6a\n#66665c5c5454\n#a8a899998484\n#9d9d00000606\n#797974740e0e\n#b5b576761414\n#070766667878\n#8f8f3f3f7171\n#42427b7b5858\n#3c3c38383636\n"
  },
  {
    "path": "colors/hemisu_dark/README.md",
    "content": "# Official dark hemisu colorscheme\n"
  },
  {
    "path": "colors/hemisu_dark/bd_color",
    "content": "#ffffffffffff\n"
  },
  {
    "path": "colors/hemisu_dark/bg_color",
    "content": "#000000000000\n"
  },
  {
    "path": "colors/hemisu_dark/fg_color",
    "content": "#eeeeeeeeeeee\n"
  },
  {
    "path": "colors/hemisu_dark/palette",
    "content": "#444444444444\n#ffff00005555\n#b1b1d6d63131\n#aeae9b9b7272\n#6868bebee4e4\n#b5b57777bcbc\n#57579a9a9f9f\n#eeeeeeeeeeee\n#777777777777\n#d6d65e5e7676\n#bbbbffffaaaa\n#ececffffc8c8\n#9f9fd3d3e6e6\n#e5e5c3c3e5e5\n#b6b6e0e0e6e6\n#ffffffffffff\n"
  },
  {
    "path": "colors/hemisu_light/README.md",
    "content": "# Official light hemisu colorscheme\n"
  },
  {
    "path": "colors/hemisu_light/bd_color",
    "content": "#000000000000\n"
  },
  {
    "path": "colors/hemisu_light/bg_color",
    "content": "#ffffffffffff\n"
  },
  {
    "path": "colors/hemisu_light/fg_color",
    "content": "#282828282828\n"
  },
  {
    "path": "colors/hemisu_light/palette",
    "content": "#777777777777\n#ffff00005555\n#737392920000\n#50503d3d1515\n#535381819292\n#5c5c34345f5f\n#535381819292\n#999999999999\n#999999999999\n#d6d65e5e7676\n#9d9dc7c70000\n#959576765656\n#9e9eb3b3cdcd\n#a2a28484a5a5\n#8585b2b2abab\n#bbbbbbbbbbbb\n"
  },
  {
    "path": "colors/jellybeans/bd_color",
    "content": "#adadadadadad\n"
  },
  {
    "path": "colors/jellybeans/bg_color",
    "content": "#151515151515\n"
  },
  {
    "path": "colors/jellybeans/fg_color",
    "content": "#e8e8e8e8d3d3\n"
  },
  {
    "path": "colors/jellybeans/palette_dconf",
    "content": "'#888888888888', '#cfcf6a6a4c4c', '#8787afaf5f5f', '#fafad0cf7a79', '#8181a3a3eded', '#c6c5b6b6eeee', '#8f8fbfbedcdc', '#e8e8e8e8d3d3', '#888888888888', '#cfcf6a6a4c4c', '#8787afaf5f5f', '#fafad0cf7a79', '#8181a3a3eded', '#c6c5b6b6eeee', '#8f8fbfbedcdc', '#e8e8e8e8d3d3'\n"
  },
  {
    "path": "colors/jellybeans/palette_gconf",
    "content": "#888888888888:#cfcf6a6a4c4c:#8787afaf5f5f:#fafad0cf7a79:#8181a3a3eded:#c6c5b6b6eeee:#8f8fbfbedcdc:#e8e8e8e8d3d3:#888888888888:#cfcf6a6a4c4c:#8787afaf5f5f:#fafad0cf7a79:#8181a3a3eded:#c6c5b6b6eeee:#8f8fbfbedcdc:#e8e8e8e8d3d3\n"
  },
  {
    "path": "colors/light/palette",
    "content": "#070736364242\n#DCDC32322F2F\n#858599990000\n#B5B589890000\n#26268B8BD2D2\n#D3D336368282\n#2A2AA1A19898\n#EEEEE8E8D5D5\n#00002B2B3636\n#CBCB4B4B1616\n#58586E6E7575\n#65657B7B8383\n#838394949696\n#6C6C7171C4C4\n#9393A1A1A1A1\n#FDFDF6F6E3E3\n"
  },
  {
    "path": "colors/nova/bd_color",
    "content": "#C5D4DD\n"
  },
  {
    "path": "colors/nova/bg_color",
    "content": "#3C4C55\n"
  },
  {
    "path": "colors/nova/fg_color",
    "content": "#C5D4DD\n"
  },
  {
    "path": "colors/nova/palette",
    "content": "#3C4C55\n#DF8C8C\n#A8CE93\n#DADA93\n#83AFE5\n#9A93E1\n#7FC1CA\n#C5D4DD\n#899BA6\n#F2C38F\n#A8CE93\n#DADA93\n#83AFE5\n#D18EC2\n#7FC1CA\n#E6EEF3\n"
  },
  {
    "path": "colors/solarized_dark/README.md",
    "content": "# Official dark solarized colorscheme\n\nhttp://ethanschoonover.com/solarized\n"
  },
  {
    "path": "colors/solarized_dark/bd_color",
    "content": "#9393a1a1a1a1\n"
  },
  {
    "path": "colors/solarized_dark/bg_color",
    "content": "#00002B2B3636\n"
  },
  {
    "path": "colors/solarized_dark/fg_color",
    "content": "#838394949696\n"
  },
  {
    "path": "colors/solarized_dark/palette",
    "content": "#070736364242\n#DCDC32322F2F\n#858599990000\n#B5B589890000\n#26268B8BD2D2\n#D3D336368282\n#2A2AA1A19898\n#EEEEE8E8D5D5\n#00002B2B3636\n#CBCB4B4B1616\n#58586E6E7575\n#65657B7B8383\n#838394949696\n#6C6C7171C4C4\n#9393A1A1A1A1\n#FDFDF6F6E3E3\n"
  },
  {
    "path": "colors/solarized_dark_alternative/README.md",
    "content": "# Dark solarized alternative, by reychino (Reinaldo Zapata)\n\nDark solarized colorscheme fork, with a different palette, to avoid the\n\"invisible\" text bug.\n"
  },
  {
    "path": "colors/solarized_dark_alternative/bd_color",
    "content": "#9393a1a1a1a1\n"
  },
  {
    "path": "colors/solarized_dark_alternative/bg_color",
    "content": "#00002B2B3636\n"
  },
  {
    "path": "colors/solarized_dark_alternative/fg_color",
    "content": "#838394949696\n"
  },
  {
    "path": "colors/solarized_dark_alternative/palette",
    "content": "#00002B2B3636\n#CBCB4B4B1616\n#58586E6E7575\n#65657B7B8383\n#838394949696\n#6C6C7171C4C4\n#9393A1A1A1A1\n#FDFDF6F6E3E3\n#070736364242\n#DCDC32322F2F\n#858599990000\n#B5B589890000\n#26268B8BD2D2\n#D3D336368282\n#2A2AA1A19898\n#EEEEE8E8D5D5\n"
  },
  {
    "path": "colors/solarized_light/README.md",
    "content": "# Official light solarized colorscheme\n\nhttp://ethanschoonover.com/solarized\n"
  },
  {
    "path": "colors/solarized_light/bd_color",
    "content": "#58586e6e7575\n"
  },
  {
    "path": "colors/solarized_light/bg_color",
    "content": "#fdfdf6f6e3e3\n"
  },
  {
    "path": "colors/solarized_light/fg_color",
    "content": "#65657b7b8383\n"
  },
  {
    "path": "colors/solarized_light/palette",
    "content": "#070736364242\n#DCDC32322F2F\n#858599990000\n#B5B589890000\n#26268B8BD2D2\n#D3D336368282\n#2A2AA1A19898\n#EEEEE8E8D5D5\n#00002B2B3636\n#CBCB4B4B1616\n#58586E6E7575\n#65657B7B8383\n#838394949696\n#6C6C7171C4C4\n#9393A1A1A1A1\n#FDFDF6F6E3E3\n"
  },
  {
    "path": "install.sh",
    "content": "#!/usr/bin/env bash\ndir=$(dirname \"$0\")\n\ndeclare -a schemes\nschemes=($(cd $dir/colors && echo * && cd - > /dev/null))\n\nsource $dir/src/tools.sh\nsource $dir/src/profiles.sh\nsource $dir/src/dircolors.sh\n\nshow_help() {\n  echo \"Usage: install.sh [-h] [-s <scheme>] [-p <profile>]\"\n  echo\n  echo \"Options\"\n  echo \"  -h, --help\"\n  echo \"    Show this information\"\n  echo \"  -s scheme, --scheme scheme, --scheme=scheme\"\n  echo \"    Color scheme to be used (will be asked otherwise)\"\n  echo \"  -p profile, --profile profile, --profile profile\"\n  echo \"    Gnome Terminal profile to overwrite (will be asked otherwise)\"\n  echo \"  --install-dircolors, --skip-dircolors\"\n  echo \"    Do or skip the dircolors installation in a non interactive mode\"\n}\n\nvalidate_scheme() {\n  local profile=$1\n  in_array $scheme \"${schemes[@]}\" || die \"$scheme is not a valid scheme\" 2\n}\n\nset_profile_colors() {\n  local profile=$1\n  local scheme=$2\n  local scheme_dir=$dir/colors/$scheme\n\n  local bg_color_file=$scheme_dir/bg_color\n  local fg_color_file=$scheme_dir/fg_color\n  local bd_color_file=$scheme_dir/bd_color\n\n  if [ \"$newGnome\" = \"1\" ]\n    then local profile_path=$dconfdir/$profile\n\n    # set color palette\n    dconf write $profile_path/palette \"$(to_dconf < $scheme_dir/palette)\"\n\n    # set foreground, background and highlight color\n    dconf write $profile_path/bold-color \"'$(cat $bd_color_file)'\"\n    dconf write $profile_path/background-color \"'$(cat $bg_color_file)'\"\n    dconf write $profile_path/foreground-color \"'$(cat $fg_color_file)'\"\n\n    # make sure the profile is set to not use theme colors\n    dconf write $profile_path/use-theme-colors \"false\"\n\n    # set highlighted color to be different from foreground color\n    dconf write $profile_path/bold-color-same-as-fg \"false\"\n\n  else\n    local profile_path=$gconfdir/$profile\n\n    # set color palette\n    gconftool-2 -s -t string $profile_path/palette \"$(to_gconf < $scheme_dir/palette)\"\n\n    # set foreground, background and highlight color\n    gconftool-2 -s -t string $profile_path/bold_color $(cat $bd_color_file)\n    gconftool-2 -s -t string $profile_path/background_color \\\n        $(cat $bg_color_file)\n    gconftool-2 -s -t string $profile_path/foreground_color \\\n        $(cat $fg_color_file)\n\n    # make sure the profile is set to not use theme colors\n    gconftool-2 -s -t bool $profile_path/use_theme_colors false\n\n    # set highlighted color to be different from foreground color\n    gconftool-2 -s -t bool $profile_path/bold_color_same_as_fg false\n  fi\n}\n\ninteractive_help() {\n  echo\n  echo -en \"This script will ask you which color scheme you want, and which \"\n  echo -en \"Gnome Terminal profile to overwrite.\\n\"\n  echo\n  echo -en \"Please note that there is no uninstall option yet. If you do not \"\n  echo -en \"wish to overwrite any of your profiles, you should create a new \"\n  echo -en \"profile before you run this script. However, you can reset your \"\n  echo -en \"colors to the Gnome default, by running:\\n\"\n  echo\n  echo \"    Gnome >= 3.8 dconf reset -f /org/gnome/terminal/legacy/profiles:/\"\n  echo \"    Gnome < 3.8 gconftool-2 --recursive-unset /apps/gnome-terminal\"\n  echo\n  echo -en \"By default, it runs in the interactive mode, but it also can be \"\n  echo -en \"run non-interactively, just feed it with the necessary options, \"\n  echo -en \"see 'install.sh --help' for details.\\n\"\n  echo\n}\n\ninteractive_select_scheme() {\n  echo \"Please select a color scheme:\"\n  select scheme\n  do\n    if [[ -z $scheme ]]\n    then\n      die \"ERROR: Invalid selection -- ABORTING!\" 2\n    fi\n    break\n  done\n  echo\n}\n\ninteractive_confirm() {\n  local confirmation\n\n  echo    \"You have selected:\"\n  echo\n  echo    \"  Scheme:  $scheme\"\n  echo    \"  Profile: $(get_profile_name $profile) ($profile)\"\n  echo\n  echo    \"Are you sure you want to overwrite the selected profile?\"\n  echo -n \"(YES to continue) \"\n\n  read confirmation\n  if [[ $(echo $confirmation | tr '[:lower:]' '[:upper:]') != YES ]]\n  then\n    die \"ERROR: Confirmation failed -- ABORTING!\"\n  fi\n\n  echo    \"Confirmation received -- applying settings\"\n}\n\nwhile [ $# -gt 0 ]\ndo\n  case $1 in\n    -h | --help )\n      show_help\n      exit 0\n    ;;\n    --scheme=* )\n      scheme=${1#*=}\n    ;;\n    -s | --scheme )\n      scheme=$2\n      shift\n    ;;\n    --profile=* )\n      profile=${1#*=}\n    ;;\n    -p | --profile )\n      profile=$2\n      shift\n    ;;\n    --install-dircolors )\n      install_dircolors=true\n    ;;\n    --skip-dircolors )\n      install_dircolors=false\n    ;;\n  esac\n  shift\ndone\n\nif [[ -z \"$scheme\" ]] || [[ -z \"$profile\" ]]\nthen\n  interactive_help\nfi\n\nif [[ -n \"$scheme\" ]]\n  then validate_scheme $scheme\nelse\n  interactive_select_scheme \"${schemes[@]}\"\nfi\n\nif [[ -n \"$profile\" ]]\n  then if [ \"$newGnome\" = \"1\" ]\n    then profile=\"$(get_uuid \"$profile\")\"\n  fi\n  validate_profile $profile\nelse\n  if [ \"$newGnome\" = \"1\" ]\n    then check_empty_profile\n  fi\n  interactive_select_profile \"${profiles[@]}\"\n  interactive_confirm\nfi\n\nset_profile_colors $profile $scheme\n\nif [ -n \"$install_dircolors\" ]\n    then if \"$install_dircolors\"\n        then copy_dircolors\n    fi\nelse\n    check_dircolors || warning_message_dircolors\nfi\n"
  },
  {
    "path": "src/color_conversions.rb",
    "content": "# input: a string like \"rgb(68,68,68)\"\n# output: the hex code like #444444444444\ndef rgb_to_48bit_hex(rgb_color)\n  colors = rgb_color.gsub(\"rgb\\(\", \"\").gsub(\"\\)\", \"\").split(\",\")\n  hex_color = \"#\"\n  colors.each do |color|\n    hex_color += sprintf(\"%02x%02x\", color.to_i, color.to_i)\n  end\n  return hex_color\nend\n\n# input: an array of colors in rgb format, like: [ 'rgb(68,68,68)', 'rgb(255,0,85)', ... ]\n# output: a dconf-compatible 48 bit color palette, like: '#444444444444', '#ffff00005555', ...\ndef rgb_palette_to_dconf(rgb_palette)\n  hex_palette = rgb_palette_to_hex(rgb_palette)\n  hex_palette.map { |hex_color| \"'#{hex_color}'\" }.join(\", \")\nend\n\n# input: an array of colors in rgb format, like: [ 'rgb(68,68,68)', 'rgb(255,0,85)', ... ]\n# output: a gconf-compatible 48 bit color palette, like: #444444444444:#ffff00005555:...\ndef rgb_palette_to_gconf(rgb_palette)\n  hex_palette = rgb_palette_to_hex(rgb_palette)\n  hex_palette.join(\":\")\nend\n\ndef rgb_palette_to_hex(rgb_palette)\n  hex_colors = []\n  rgb_palette.each do |rgb_color|\n    hex_colors << rgb_to_48bit_hex(rgb_color)\n  end\n  hex_colors\nend\n\n# Example script:\n\n#    rgb_palette = ['rgb(68,68,68)','rgb(255,0,85)','rgb(177,214,49)','rgb(174,155,114)','rgb(104,190,228)','rgb(181,119,188)','rgb(87,154,159)','rgb(238,238,238)','rgb(119,119,119)','rgb(214,94,118)','rgb(187,255,170)','rgb(236,255,200)','rgb(159,211,230)','rgb(229,195,229)','rgb(182,224,230)','rgb(255,255,255)']\n#    background_color = 'rgb(0,0,0)'\n#    foreground_color = 'rgb(238,238,238)'\n#    bold_color       = 'rgb(255,255,255)'\n\n\n#    puts \" --- Gconf:\"\n#    puts rgb_palette_to_gconf rgb_palette\n#    puts \" --- Dconf:\"\n#    puts rgb_palette_to_dconf rgb_palette\n#    puts \" --- Background:\"\n#    puts rgb_to_48bit_hex background_color\n#    puts \" --- Foreground:\"\n#    puts rgb_to_48bit_hex foreground_color\n#    puts \" --- Bold:\"\n#    puts rgb_to_48bit_hex bold_color\n"
  },
  {
    "path": "src/dircolors.sh",
    "content": "#!/usr/bin/env bash\n\ndircolors_checked=false\nDIRCOLORS_DIR=\"$(echo ~/.dir_colors)\"\nDIRCOLORS_SOLARIZED=\"$(pwd)\"\nDIRCOLORS_REPO_ADRESS=\"https://github.com/seebi/dircolors-solarized\"\nDIRCOLORS_DL_ADRESS=\"https://raw.github.com/seebi/dircolors-solarized/master/\"\n\ndl_dircolors() {\n  echo\n  eval \"wget -O \"$DIRCOLORS_SOLARIZED/dircolors\" \\\n      \"$DIRCOLORS_DL_ADRESS/dircolors.ansi-$scheme\"\"\n  valid=$?\n  if [ ! \"$valid\" == \"0\" -o ! -e \"$DIRCOLORS_SOLARIZED/dircolors\" ]\n    then echo -e \"Download failed, dircolors will not be copied but you \"\n    echo -en \"can install it from the official repository : \"\n    echo \"$DIRCOLORS_REPO_ADRESS\"\n    return 1\n  fi\n  return 0\n}\n\ncopy_dircolors() {\n  dircolors_dest_path=\"$DIRCOLORS_DIR/dircolors\"\n  eval dl_dircolors\n  dl_ok=$?\n  if [ $dl_ok ]\n    # CentOS uses ~/.dir_colors as dir_colors file\n    then if [ -f \"$DIRCOLORS_DIR\" ]\n      then dircolors_dest_path=\"$DIRCOLORS_DIR\"\n    else\n      mkdir -p \"$DIRCOLORS_DIR\"\n    fi\n\n    if [ -f \"$dircolors_dest_path\" ]\n      then mv \"$dircolors_dest_path\" \"$dircolors_dest_path.old\"\n      echo -n \"$dircolors_dest_path already exists, renaming it to \"\n      echo    \"$dircolors_dest_path.old\"\n    fi\n  fi\n  cp \"$DIRCOLORS_SOLARIZED/dircolors\" \"$dircolors_dest_path\"\n\n  echo\n  echo \"The new dircolors have been installed as $dircolors_dest_path.\"\n  echo\n  echo -n \"Add \\\"eval \\`dircolors /path/to/dircolorsdb\\`\\\" in your shell \"\n  echo    \"configuration file (.bashrc, .zshrc, etc...) to use new dircolors.\"\n  echo    \"For Fish, add the following to config.fish instead:\"\n  echo -e \"\\teval (dircolors /path/to/dircolorsdb | head -n 1 | sed 's/^LS_COLORS=/set -x LS_COLORS /;s/;$//')\"\n  echo\n  echo -en \"Do not forget to remove old dircolors from your shell \"\n  echo -en \"configuration file if they were named differently than \"\n  echo -en \"the one newly installed.\\n\"\n  echo\n}\n\nmsg_create_dircolors() {\n  echo -en \"A dircolors adapted to solarized can be automatically \"\n  echo -en \"downloaded.\\n\"\n  echo\n  echo -en \"1) Download seebi' dircolors-solarized: \"\n  echo -en \"https://github.com/seebi/dircolors-solarized\\n\"\n  echo\n  echo -en \"2) [DEFAULT] I don't need any dircolors.\\n\"\n}\n\nmsg_already_existing_dircolors() {\n  echo -en \"A dircolors already exists in $DIRCOLORS_DIR, but can be \"\n  echo -en \"incompatible with the solarized color scheme causing some colors \"\n  echo -en \"problems when doing a \\\"ls\\\".\\n\"\n  echo\n  echo -en \"1) Replace the actual dircolors by seebi' \"\n  echo -en \"dircolors-solarized: \"\n  echo -en \"https://github.com/seebi/dircolors-solarized (the actual \"\n  echo -en \"dircolors will be keeped as backup).\\n\"\n  echo\n  echo -en \"2) [DEFAULT] I am awared about this potentiall problem and will \"\n  echo -en \"check my dircolors (default path: ~/.dir_colors/dircolors) \"\n  echo -en \"in case of conflict.\\n\"\n}\n\ninteractive_dircolors() {\n  already_existing_dircolors=$1\n  noselect=true\n  while $noselect\n  do\n    echo\n\n    if $already_existing_dircolors\n      then msg_already_existing_dircolors\n    else\n      msg_create_dircolors\n    fi\n\n    echo\n    read -p \"Enter your choice : [2] \" selection\n    selection=${selection:-2}\n\n    if [[ \"$selection\" -gt 2 || \"$selection\" -lt 1 ]]\n      then echo \"$selection is not a valid entry. Please Restart\"\n      echo\n      noselect=true\n    else\n      noselect=false\n    fi\n  done\n\n  if [ \"$selection\" == 1 ]\n    then copy_dircolors\n  fi\n}\n\ncheck_dircolors() {\n  nonempty=false\n  if [ -d \"$DIRCOLORS_DIR\" ]\n    then  [ \"$(ls -A $DIRCOLORS_DIR)\" ] && nonempty=true || nonempty=false\n  fi\n  interactive_dircolors $nonempty\n  return $(! $nonempty)\n}\n\nwarning_message_dircolors() {\n  echo -en \"If there is any problem with the colors when doing a \\\"ls\\\", \"\n  echo -en \"please check your dircolors.\\n\"\n}\n\n"
  },
  {
    "path": "src/profiles.sh",
    "content": "#!/usr/bin/env bash\n\ngnomeVersion=\"$(expr \"$(gnome-terminal --version)\" : '.* \\(.*[.].*[.].*\\)$')\"\ndircolors_checked=false\n\n\ndeclare -a profiles\nif [ \"$newGnome\" = \"1\" ]\n  then profiles=($(dconf list $dconfdir/ | grep ^: | sed 's/\\///g'))\nelse\n  profiles=($(gconftool-2 -R $gconfdir | grep $gconfdir | cut -d/ -f5 |  \\\n           cut -d: -f1))\nfi\n\n\ncreate_new_profile() {\n  profile_id=\"$(uuidgen)\"\n  dconf write $dconfdir/default \"'$profile_id'\"\n  dconf write $dconfdir/list \"['$profile_id']\"\n  profile_dir=\"$dconfdir/:$profile_id\"\n  dconf write $profile_dir/visible-name \"'Default'\"\n}\n\nget_uuid() {\n  # Print the UUID linked to the profile name sent in parameter\n  local profile_name=$1\n  for i in ${!profiles[*]}\n    do\n      if [[ \"$(dconf read $dconfdir/${profiles[i]}/visible-name)\" == \\\n          \"'$profile_name'\" ]]\n        then echo \"${profiles[i]}\"\n        return 0\n      fi\n    done\n  echo \"$profile_name\"\n}\n\nvalidate_profile() {\n  local profile=$1\n  in_array $profile \"${profiles[@]}\" || die \"$profile is not a valid profile\" 3\n}\n\nget_profile_name() {\n  local profile_name\n\n  # dconf still return \"\" when the key does not exist, gconftool-2 return 0,\n  # but it does priint error message to STDERR, and command substitution\n  # only gets STDOUT which means nothing at this point.\n  if [ \"$newGnome\" = \"1\" ]\n    then profile_name=\"$(dconf read $dconfdir/$1/visible-name | sed s/^\\'// | \\\n        sed s/\\'$//)\"\n  else\n    profile_name=$(gconftool-2 -g $gconfdir/$1/visible_name)\n  fi\n  [[ -z $profile_name ]] && die \"$1 (No name)\" 3\n  echo $profile_name\n}\n\ninteractive_new_profile() {\n  local confirmation\n\n  echo    \"No profile found\"\n  echo    \"You need to create a new default profile to continue. Continue?\"\n  echo -n \"(YES to continue) \"\n\n  read confirmation\n  if [[ $(echo $confirmation | tr '[:lower:]' '[:upper:]') != YES ]]\n  then\n    die \"ERROR: Confirmation failed -- ABORTING!\"\n  fi\n\n  echo -e \"Profile \\\"Default\\\" created\\n\"\n}\n\ninteractive_select_profile() {\n  local profile_key\n  local profile_name\n  local profile_names\n  local profile_count=$#\n\n  declare -a profile_names\n  while [ $# -gt 0 ]\n  do\n    profile_names[$(($profile_count - $#))]=$(get_profile_name $1)\n    shift\n  done\n\n  set -- \"${profile_names[@]}\"\n\n  echo \"Please select a Gnome Terminal profile:\"\n  select profile_name\n  do\n    if [[ -z $profile_name ]]\n    then\n      die \"ERROR: Invalid selection -- ABORTING!\" 3\n    fi\n    profile_key=$(expr ${REPLY} - 1)\n    break\n  done\n  echo\n\n  profile=${profiles[$profile_key]}\n}\n\n\ncheck_empty_profile() {\n  if [ \"$profiles\" = \"\" ]\n    then interactive_new_profile\n    create_new_profile\n    profiles=($(dconf list $dconfdir/ | grep ^: | sed 's/\\///g'))\n  fi\n}\n"
  },
  {
    "path": "src/tools.sh",
    "content": "#!/usr/bin/env bash\ngnomeVersion=\"$(expr \\\n    \"$(LANGUAGE=en_US.UTF-8 gnome-terminal --version)\" : \\\n    '^[^[:digit:]]* \\(\\([[:digit:]]*\\.*\\)*\\)' \\\n)\"\n\n# newGnome=1 if the gnome-terminal version >= 3.8\nif [[ (\"$(echo \"$gnomeVersion\" | cut -d\".\" -f1)\" = \"3\" && \\\n       \"$(echo \"$gnomeVersion\" | cut -d\".\" -f2)\" -ge 8) || \\\n       \"$(echo \"$gnomeVersion\" | cut -d\".\" -f1)\" -ge 4 ]]\n  then newGnome=\"1\"\n  dconfdir=/org/gnome/terminal/legacy/profiles:\nelse\n  newGnome=0\n  gconfdir=/apps/gnome-terminal/profiles\nfi\n\ndie() {\n  echo $1\n  exit ${2:-1}\n}\n\nin_array() {\n  local e\n  for e in \"${@:2}\"; do [[ $e == $1 ]] && return 0; done\n  return 1\n}\n\nto_gconf() {\n  tr '\\n' \\: | sed 's#:$#\\n#'\n}\n\nto_dconf() {\n  tr '\\n' '~' | sed -e \"s#~\\$#']\\n#\" -e \"s#~#', '#g\" -e \"s#^#['#\"\n}\n"
  },
  {
    "path": "tools/import_from_iterm.rb",
    "content": "#!/usr/bin/env ruby\n\n# imports an iTerm color profile to gnome terminal\n# syntax: import_from_iterm.rb <path_to_profile> <profile_name>\n\nrequire 'nokogiri'\nrequire 'nokogiri-plist'\n\nclass Color\n  attr_accessor :red\n  attr_accessor :green\n  attr_accessor :blue\n\n  def initialize(args={})\n    args.each_pair do |k, v|\n      self.send(\"#{k}=\", v)\n    end\n  end\n\n  def to_48bit_hex\n    red_part   = sprintf(\"%04x\", (red.to_f   * 65535).round)\n    green_part = sprintf(\"%04x\", (green.to_f * 65535).round)\n    blue_part  = sprintf(\"%04x\", (blue.to_f  * 65535).round)\n    \"##{red_part}#{green_part}#{blue_part}\"\n  end\nend\n\nfile_path    = ARGV[0]\nprofile_name = ARGV[1]\n\nunless file_path && profile_name\n  puts \"Syntax: import_from_iterm.rb <path_to_profile> <profile_name>\"\n  exit(-1)\nend\n\nif Dir.exists?(\"colors/#{profile_name}\")\n  puts \"Color #{profile_name} already exists, delete it or choose a different name\"\n  exit(-1)\nend\n\ninput = File.open(file_path)\nplist = Nokogiri::PList(input)\ninput.close\n\n# First of all, we need to collect values for each ansi color\n# Label inside plist file is like \"Ansi 0 Color\"\n\ncolors = {}\n(0).upto(15) do |count|\n  label = \"Ansi #{count} Color\"\n  data  = plist[label]\n  colors[label] = Color.new(\n    red: data['Red Component'],\n    green: data['Green Component'],\n    blue: data['Blue Component'],\n  )\nend\n\n# Now, we need to collect other data: background color, foreground color, and bold color\n\n['Background Color', 'Foreground Color', 'Bold Color'].each do |label|\n  data  = plist[label] || {}\n  colors[label] = Color.new(\n    red: data['Red Component'],\n    green: data['Green Component'],\n    blue: data['Blue Component'],\n  )\nend\n\n# Very good. Now we have all we need to generate the Gnome Terminal color profile.\n\n# Let's start creating a directory\n\nDir.mkdir(\"colors/#{profile_name}\")\n\n# now, the palettes. Let's build it first\n\npalette = []\n(0).upto(15) do |count|\n  label = \"Ansi #{count} Color\"\n  color_code_48_bit = colors[label].to_48bit_hex\n  palette << color_code_48_bit\nend\n\n# now let's write the dconf palette\nFile.open(\"colors/#{profile_name}/palette_dconf\", \"w\") do |f|\n  f.puts palette.map { |color| \"'#{color}'\"}.join(\", \")\nend\n\n# and the gconf palette\nFile.open(\"colors/#{profile_name}/palette_gconf\", \"w\") do |f|\n  f.puts palette.join(\":\")\nend\n\n# bold color\nFile.open(\"colors/#{profile_name}/bd_color\", \"w\") do |f|\n  f.puts colors['Bold Color'].to_48bit_hex\nend\n\n# background color\nFile.open(\"colors/#{profile_name}/bg_color\", \"w\") do |f|\n  f.puts colors['Background Color'].to_48bit_hex\nend\n\n# Foreground color\nFile.open(\"colors/#{profile_name}/fg_color\", \"w\") do |f|\n  f.puts colors['Foreground Color'].to_48bit_hex\nend\n\n# A little README.md file\nFile.open(\"colors/#{profile_name}/README.md\", \"w\") do |f|\n  f.puts \"Colorscheme #{profile_name} - imported from iterm on #{Time.now}\" \nend\n\nputs \"Done!\"\n"
  }
]