Skip to content

Instantly share code, notes, and snippets.

@lludlow
Forked from kynan/solarize-terminator.sh
Created February 28, 2017 21:12
Show Gist options
  • Save lludlow/65c45d8a7ec6f4bedfe5dd1f8b8ba558 to your computer and use it in GitHub Desktop.
Save lludlow/65c45d8a7ec6f4bedfe5dd1f8b8ba558 to your computer and use it in GitHub Desktop.
shell script for setting terminator color palette to use Solarized theme
#!/bin/bash
#
# Shell script that configures terminator to use solarized theme
# colors. Assumes a single terminator profile. Tested on Ubuntu 11.10.
#
# Solarized theme: http://ethanschoonover.com/solarized
#
# Original from 79CetiB:
# http://www.reddit.com/r/emacs/comments/npfmv/i_need_some_help_with_the_solarized_theme_in_a/c3b4mds
#
# Adapted from these sources:
# https://gist.github.com/1397104
# http://xorcode.com/guides/solarized-vim-eclipse-ubuntu/
# http://codefork.com/blog/index.php/2011/11/27/getting-the-solarized-theme-to-work-in-emacs/
# http://www.sharms.org/blog/2010/08/terminator-color-palettes/
PALETTE=
BG_COLOR=
FG_COLOR=
case "${1}" in
"dark")
PALETTE='palette = "#070736364242:#D3D301010202:#858599990000:#B5B589890000:#26268B8BD2D2:#D3D336368282:#2A2AA1A19898:#EEEEE8E8D5D5:#00002B2B3636:#CBCB4B4B1616:#58586E6E7575:#65657B7B8383:#838394949696:#6C6C7171C4C4:#9393A1A1A1A1:#FDFDF6F6E3E3"'
BG_COLOR='background\_color = "#00002B2B3636"'
FG_COLOR='foreground\_color = "#65657B7B8383"'
;;
"light")
PALETTE='palette = "#EEEEE8E8D5D5:#D3D301010202:#858599990000:#B5B589890000:#26268B8BD2D2:#D3D336368282:#2A2AA1A19898:#070736364242:#FDFDF6F6E3E3:#CBCB4B4B1616:#9393A1A1A1A1:#838394949696:#65657B7B8383:#6C6C7171C4C4:#58586E6E7575:#00002B2B3636"'
BG_COLOR='background\_color = "#FDFDF6F6E3E3"'
FG_COLOR='foreground\_color = "#838394949696"'
;;
*)
echo "Usage: solarized_terminator [light | dark]"
exit 1
;;
esac
sed -i "s_palette.*_${PALETTE}_;s_background\_color.*_${BG_COLOR}_;s_foreground\_color.*_${FG_COLOR}_" ~/.config/terminator/config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment