├── screenshot.png ├── Solarized Dark.scpt ├── Solarized Light.scpt ├── Toggle Solarized.scpt ├── Solarized Dark.applescript ├── Solarized Light.applescript ├── README.md ├── LICENSE └── Toggle Solarized.applescript /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaywilliams/iterm2-colors-solarized-toggle/HEAD/screenshot.png -------------------------------------------------------------------------------- /Solarized Dark.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaywilliams/iterm2-colors-solarized-toggle/HEAD/Solarized Dark.scpt -------------------------------------------------------------------------------- /Solarized Light.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaywilliams/iterm2-colors-solarized-toggle/HEAD/Solarized Light.scpt -------------------------------------------------------------------------------- /Toggle Solarized.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaywilliams/iterm2-colors-solarized-toggle/HEAD/Toggle Solarized.scpt -------------------------------------------------------------------------------- /Solarized Dark.applescript: -------------------------------------------------------------------------------- 1 | tell application "iTerm" 2 | try 3 | set _session to current session of current terminal 4 | on error 5 | tell me to quit 6 | end try 7 | 8 | tell _session 9 | -- Apple script colors are specified in RGB, 10 | -- with ranges from 0 to 65535. 11 | 12 | set fg_color to get foreground color 13 | 14 | if fg_color is {21074, 26471, 28270} then 15 | -- Solarized Dark Theme 16 | set foreground color to {28873, 33398, 33872} 17 | set background color to {0, 7722, 9941} 18 | set bold color to {33153, 37008, 37008} 19 | set selection color to {0, 10280, 12593} 20 | set selected text color to {33153, 37008, 37008} 21 | set cursor color to {28784, 33410, 33924} 22 | set cursor_text color to {0, 10207, 12694} 23 | end if 24 | end tell 25 | end tell -------------------------------------------------------------------------------- /Solarized Light.applescript: -------------------------------------------------------------------------------- 1 | tell application "iTerm" 2 | try 3 | set _session to current session of current terminal 4 | on error 5 | tell me to quit 6 | end try 7 | 8 | tell _session 9 | -- Apple script colors are specified in RGB, 10 | -- with ranges from 0 to 65535. 11 | 12 | set fg_color to get foreground color 13 | 14 | if fg_color is {28873, 33398, 33872} then 15 | -- Solarized Light Theme 16 | set foreground color to {21074, 26471, 28270} 17 | set background color to {64842, 62778, 56626} 18 | set bold color to {18134, 23373, 25098} 19 | set selection color to {60138, 58339, 52171} 20 | set selected text color to {18134, 23373, 25098} 21 | set cursor color to {21257, 26684, 28737} 22 | set cursor_text color to {60037, 58326, 52284} 23 | end if 24 | end tell 25 | end tell -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iTerm2 Toggle Solarized Mode 2 | 3 | ## Installation 4 | 5 | To install place *Toggle Solarized.scpt* inside iTerm's Scripts directory, 6 | which you'll need to create if it doesn't exist, and reload iTerm. 7 | 8 | ~/Library/Application Support/iTerm/Scripts 9 | 10 | Now you can switch between light and dark modes, with a click of a button. 11 | 12 | Also included is a plain-text version of the script, so you can easily see 13 | what's going on under the hood. 14 | 15 | ## Screenshot 16 | 17 | ![](screenshot.png) 18 | 19 | ## Tips 20 | 21 | You can toggle via command line too, however this doesn't work properly within 22 | tmux sessions. 23 | 24 | osascript ~/Library/Application\ Support/iTerm/Scripts/Toggle\ Solarized.scpt 25 | 26 | ## Resources 27 | - [Solarized Homepage](http://ethanschoonover.com/solarized) 28 | - [iTerm2 Color Presets](https://github.com/altercation/solarized/tree/master/iterm2-colors-solarized) 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Jay Williams 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /Toggle Solarized.applescript: -------------------------------------------------------------------------------- 1 | tell application "iTerm" 2 | activate 3 | 4 | try 5 | set _session to current session of current terminal 6 | on error 7 | set _term to (make new terminal) 8 | tell _term 9 | launch session "Default" 10 | set _session to current session 11 | end tell 12 | end try 13 | 14 | tell _session 15 | -- Apple script colors are specified in RGB, 16 | -- with ranges from 0 to 65535. 17 | 18 | set fg_color to get foreground color 19 | 20 | if fg_color is {28873, 33398, 33872} then 21 | -- Solarized Light Theme 22 | set foreground color to {21074, 26471, 28270} 23 | set background color to {64842, 62778, 56626} 24 | set bold color to {18134, 23373, 25098} 25 | set selection color to {60138, 58339, 52171} 26 | set selected text color to {18134, 23373, 25098} 27 | set cursor color to {21257, 26684, 28737} 28 | set cursor_text color to {60037, 58326, 52284} 29 | else 30 | -- Solarized Dark Theme 31 | set foreground color to {28873, 33398, 33872} 32 | set background color to {0, 7722, 9941} 33 | set bold color to {33153, 37008, 37008} 34 | set selection color to {0, 10280, 12593} 35 | set selected text color to {33153, 37008, 37008} 36 | set cursor color to {28784, 33410, 33924} 37 | set cursor_text color to {0, 10207, 12694} 38 | end if 39 | end tell 40 | end tell --------------------------------------------------------------------------------