tech.zpoley.net

quick little hacks 
Filed under

Terminal

 

OS X Day and Night Terminals

(download)
I recently found time to explore creating separate OS X Terminal styles for day and night. Here is my solution, please let me know if you have a better setup.

First, I created two different themes in iTerm2 or Terminal.

Then I created two AppleScripts called "Dayterm" and "Nightterm" below:

The AppleScripts write to both Terminal or iTerm2 OS X defaults properties. Then, I saved the AppleScripts as Applications and now I can do spotlight "Dayterm" or spotlight "Nightterm" to use one or the other. Setting the defaults shown means that opening new tabs or windows from within the opened terminal app will use the same Dayterm or Nightterm style as the one that was opened. Exporting the "SHELL_VIBE" variable allows reading the current Terminal style from other places like .vimrc for instance to further customize the terminal experience for Day or Night.

Doing all of my work in Tmux also allows me to detach my Tmux client and switch Terminal styles and re-attach to the same Tmux session in the new Terminal style.

Filed under  //   AppleScript   Day   Night   OS X   Styles   Terminal   iTerm2  

Comments [1]