Sublime Forum

ST3: ThemeScheduler

#1

ThemeScheduler is a plugin I wrote a while ago. It changes your themes based on the time of day (this isn’t the first to do this, but it does have some other useful features, like what it can do when ThemeTweaker is installed). It has the added features of popping up user defined messages at time changes (if defined). If you have ThemeTweaker installed github.com/facelessuser/ThemeTweaker, you can have it define filters to apply to your themes at certain times as well. Maybe darken your background as the hours get later. Colorize your entire theme red when you need to go home, or whatever you desire.

Example for changing themes:
[pre=#141414] “themes”:

    {
        "theme": "Packages/User/Color Scheme/sometheme.tmTheme",
        "time": "21:30"
    },
    {
        "theme": "Packages/User/Color Scheme/someothertheme.tmTheme",
        "time": "8:30"
    }
][/pre]

Example for using filters (see ThemeTweaker filter documentation)](github.com/facelessuser/ThemeTw … er-command):
[pre=#141414] “themes”:

    {
        "theme": "Packages/User/Color Scheme/Tomorrow-Night-Eighties.tmTheme",
        "filters": "brightness(.98)@bg",
        "time": "10:00"
    },
    {
        "theme": "Packages/User/Color Scheme/Tomorrow-Night-Eighties.tmTheme",
        "filters": "brightness(.97)@bg",
        "time": "11:00"
    }
][/pre]

Example for displaying messages at theme change:
[pre=#141414] “themes”:

    {
        // Lunch
        "theme": "Packages/User/Color Scheme/Tomorrow-Night-Eighties.tmTheme",
        "filters": "brightness(.96)@bg;glow(.1)",
        "time": "12:00",
        "msg": "Lunch time!"
    }
][/pre]

Anyways the repo and info is here: github.com/facelessuser/ThemeScheduler

0 Likes

#2

Now on Package Control.

0 Likes

#3

Now can use SubNotify for messages. github.com/facelessuser/SubNotify

See repo for more info.

0 Likes

#4

Theme scheduler can now change your UI theme via the option “ui_theme”. I plan to add the ability to run a sublime command on theme change as well, so if that sounds useful to you, stay tuned.

0 Likes

#5

Can now accept ApplicationCommands only. If you want to run window or text commands, you will have to wrap them in an ApplicationCommand.

Example:
[pre=#232628] {
“command”: {
“command”: “set_aprosopo_theme”, “args”:
{
“theme”: “light”,
“color”: “blue”
}
},
“time”: “21:00”
},[/pre]

That’s it.

0 Likes

#6

Recently, I have been working on some corner cases that would cause the theme to not change in certain circumstances. Usually scenarios at day changes, or induced by a day change. Yesterday, when attempting to fix one of these cases, I committed a change that would cause a loop of theme settings at the last change of the day, this was also fixed late last night my time.

All known corner cases should be fixed now. Changes should take place when they are supposed to. When the computer is a asleep, then wakes, the appropriate theme should be set on wake up. If using blocking messages (sublime default dialogs, not subnotify), on message close, theme refreshes should only occur if needed.

So, changes should be nice and reliable now. Please let me know if you are experiencing a corner case I am not aware of.

0 Likes

#7

The recent update introduced caused some regressions. While it fixed very specific scenarios, it introduced new issues. This is mainly because I was lazy and didn’t care to spend extra time on the plugin that it required. So now, I have simulated different time change events, day changes and scenarios. I think it should behave more sane now. It should update fine on all day change corner cases. It should also not go into an infinite update loop in one of these cases either. You may need to restart Sublime to make sure everything is functioning proper after the update.

I think in the future, when/if I have to edit the algorithm more, I need to code up some regression tests. It is one of those plugins, were it doesn’t really need new features, and if the functionality is solid, there is no need to update the code; so hopefully, I won’t have to touch the code again until ST4. I’m going to keep an eye on it for the next couple of weeks just in case.

Please do let me know you are having a bad experience with this plugin after the update. My intention was to make it even more stable, not less…but as we see, the verdict is still out on this one :smile:.

0 Likes

#8

Very usefull! It keeps the color scheme good for day and night, and also remember me to have lunch :slight_smile:

1 Like