randy3k / Terminus

Bring a real terminal to Sublime Text
https://packagecontrol.io/packages/Terminus
MIT License
1.39k stars 81 forks source link

Run "Generate User Theme" automatically when theme changes #296

Open Kamik423 opened 3 years ago

Kamik423 commented 3 years ago

Can this be achieved either with an event listener (I could not find a really suitable one in the documentation) or a timer running every 5 or 10 seconds that compares themes from the ui_info() command.

The sublime_auto_dark package (now defunct) which implemented automatic theme switching in ST3 checked for OS theme change every 5 minutes or when the windows was focussed. Maybe that would be a feasible option.

randy3k commented 3 years ago

when the OS theme changes?

Kamik423 commented 3 years ago

Well auto_dark had to detect OS theme change. If there is no ST event that triggers when ST color scheme changes one can use the same mechanism that auto_dark used to detect OS theme change and apply it to ST scheme change since it now follows the OS dark/light mode.

jwortmann commented 3 years ago

I assume you have "color_scheme" set to "auto" and the Terminus scheme to "adaptive"?

Yeah this edge case was missed for the adaptive Terminus theme, because once set to auto, the color_scheme option will not change when the OS theme changes, so it's not noticed in Terminus. I think there is indeed no event in the ST API that triggers on OS theme changes. So I imagine to periodically check ui_info() would be the only workaround for this, but I don't think that it would be worth it over just manually regenerating the Terminus theme after an OS theme change.

Kamik423 commented 3 years ago

I and quite some other people I know have their OS set to be light during the day and dark during the night. So opening a terminal at 2am and getting blasted by light because you forgot to change the theme is quite annoying.

Could this at least be implemented as an option?

pelemarse commented 1 year ago

Is this project still alive? Updates seem to be very passive.

randy3k commented 1 year ago

Yes, as long as I am still alive. I didn't have much time to expand the functionality, but I am still very aware of bug fixing.