#!/bin/bash # # Export an environment variable based on the terminal color scheme. Allows # programs like VIM to dynamically adjust their colors to fit the controlling # terminal. # # On Mac OS this requires setting the "Run Command" under the "Shell" tab of # the terminal profile. # if [ "$1" = "-l" ]; then export TERM_BG_SHADE="light" elif [ "$1" = "-d" ]; then export TERM_BG_SHADE="dark" else >&2 echo "WARNING: Terminal shade argument not passed!" fi exec $SHELL -l