Add plugin for dynamic switch iTerm2 theme

I want to dynamically change the theme in iterm2 depending on the time
of day
This commit is contained in:
Ivan Verevkin 2016-02-10 13:41:43 +07:00
parent a38d7cf54a
commit 131a08eff9
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,10 @@
##
**Maintainer:** [@idoo](https://github.com/idoo)
This plugin switch iTerm2 theme depends on the time of day
### Usage
Please create two profile with name `dark` and `light`

View File

@ -0,0 +1,20 @@
function set_iterm_profile() {
echo -e "\033]50;SetProfile=$1\a"
}
function start_dynamic_theme() {
HOUR=`date +%H`
if [ $HOUR -ge 8 -a $HOUR -le 17 ]; then
set_iterm_profile light
else
set_iterm_profile dark
fi
}
start_dynamic_theme &!
while true
do
start_dynamic_theme
sleep 600
done