Skip to content

Instantly share code, notes, and snippets.

@liladas

liladas/.bash_profile

Last active Feb 27, 2020
Embed
What would you like to do?
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