1
0
Fork 0

iTerm theme switching from console

This commit is contained in:
Gregory Eremin 2013-03-14 02:20:26 +04:00
parent 9dd3d223ba
commit 71aa681d36
2 changed files with 54 additions and 10 deletions

View File

@ -1647,6 +1647,8 @@
<true/>
<key>MaxVertically</key>
<false/>
<key>NSColorPanelMode</key>
<string>6</string>
<key>NSNavLastRootDirectory</key>
<string>~/.dotfiles/iterm2/themes</string>
<key>NSQuotedKeystrokeBinding</key>
@ -1683,10 +1685,12 @@
<key>TB Size Mode</key>
<integer>1</integer>
</dict>
<key>NSWindow Frame NSColorPanel</key>
<string>307 274 214 309 0 0 1440 878 </string>
<key>NSWindow Frame Preferences</key>
<string>304 393 924 485 0 0 1440 878 </string>
<key>NSWindow Frame iTerm Window 0</key>
<string>0 4 1431 874 0 0 1440 878 </string>
<string>419 240 570 426 0 0 1440 878 </string>
<key>NSWindow Frame iTerm Window 1</key>
<string>0 452 570 426 0 0 1440 878 </string>
<key>NSWindow Frame iTerm Window 2</key>
@ -2411,6 +2415,8 @@
<string>/Users/chez/Code</string>
</dict>
</array>
<key>NoSyncNeverRemindPrefsChangesCopy</key>
<true/>
<key>OnlyWhenMoreTabs</key>
<true/>
<key>OpenArrangementAtStartup</key>
@ -2507,7 +2513,7 @@
<key>UseCompactLabel</key>
<true/>
<key>UseLionStyleFullscreen</key>
<false/>
<true/>
<key>WebKitDefaultFontSize</key>
<integer>11</integer>
<key>WebKitStandardFont</key>

View File

@ -1,12 +1,50 @@
local sublime_conf_location=~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/Preferences.sublime-settings
local sublime_conf_location=~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/Preferences.sublime-settings
local theme="$1"
case $theme in
light|dark)
local sublime_conf_file="$ZSH/sublime/config-$theme" ;;
*)
local sublime_conf_file="$ZSH/sublime/config-dark" ;;
esac
rm $sublime_conf_location
cp $sublime_conf_file $sublime_conf_location
light)
cp $ZSH/sublime/config-light $sublime_conf_location
osascript <<-END
tell application "iTerm"
repeat with myTerminal in terminals
repeat with mySession in sessions in myTerminal
tell mySession
set background color to {64842, 62778, 56626}
set bold color to {18134, 23373, 25098}
set cursor color to {21257, 26684, 28737}
set cursor_text color to {60037, 58326, 52284}
set foreground color to {21257, 26684, 28737}
set selection color to {60037, 58326, 52284}
set selected text color to {18134, 23373, 25098}
end tell
end repeat
end repeat
end tell
END
;;
dark)
cp $ZSH/sublime/config-dark $sublime_conf_location
osascript <<-END
tell application "iTerm"
repeat with myTerminal in terminals
repeat with mySession in sessions in myTerminal
tell mySession
set background color to {0, 7722, 9941}
set bold color to {33160, 37017, 36937}
set cursor color to {28873, 33398, 33872}
set cursor_text color to {0, 10207, 12694}
set foreground color to {28873, 33398, 33872}
set selection color to {0, 10207, 12694}
set selected text color to {33160, 37017, 36937}
end tell
end repeat
end repeat
end tell
END
;;
esac