Skip to content

Instantly share code, notes, and snippets.



Last active Feb 27, 2020
What would you like to do?
Programmatically switch colorschemes of the terminal and gvim for brighter days. ☼
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"

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


# 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