Skip to content

Instantly share code, notes, and snippets.

@liladas
Last active February 27, 2020 04:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liladas/9a275696ae238cdf2af800976eb2afd7 to your computer and use it in GitHub Desktop.
Save liladas/9a275696ae238cdf2af800976eb2afd7 to your computer and use it in GitHub Desktop.
Programmatically switch colorschemes of the terminal and gvim for brighter days. ☼
#.bash_profile
export GVIMCOLOR=slate
alias bright="osascript ~/scripts/brighten_up.scpt \"Man Page\" &>/dev/null; export GVIMCOLOR=morning"
alias dark="osascript ~/scripts/brighten_up.scpt \"Slate\" &>/dev/null; export GVIMCOLOR=slate"
alias light="osascript ~/scripts/brighten_up.scpt \"Basic\" &>/dev/null; export GVIMCOLOR=morning"
#.gvimrc
colorscheme=$GVIMCOLOR

This macosx osascript script will toggle all terminal windows bright/dark.

Installation

# download this zip
# extract into ~/scripts/
rebash # reload shell
bright/dark/light # toggle color modes
# Set colorschemes of term and gvim
on run argv
tell application "Terminal"
repeat with w from 1 to count windows
repeat with t from 1 to count tabs of window w
set current settings of tab t of window w to (first settings set whose name is item 1 of argv)
end repeat
end repeat
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment