Skip to content

Instantly share code, notes, and snippets.

@20015jjw
Last active May 10, 2016 18:01
Show Gist options
  • Save 20015jjw/08db8dbb801c29706e76 to your computer and use it in GitHub Desktop.
Save 20015jjw/08db8dbb801c29706e76 to your computer and use it in GitHub Desktop.
Add these lines to .bash_profile to allow iterm2 to switch profiles with the time in the day.
# Define a function that switches iterm profile
iterm2_profile() { echo -e "\033]50;SetProfile=$1\a"; }
# Change profile by $HOUR
# You'll need to change name of profiles to Light and Dark
HOUR=`date +"%H"`
if [ $HOUR -gt 6 ] && [ $HOUR -lt 18 ];
then iterm2_profile Light;
else iterm2_profile Dark;
fi
# Clear the Screen
clear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment