I'm developing some dev tools to use in the Designer in Java and i'm trying to get it to run a function when the designer first launches so that I can add an icon button to the toolbar to launch my dev tools, rather than having to run it manually through the script console, but not sure how to do it...
Possible?
I have a @system.util.runInClient decorator in an upcoming toolkit release that you could leverage to do this. Basically, the inverse of @..runInGateway, but can target specific client IDs. You'd use a gateway timer event to keep track of designer session IDs, and fire a target function for each new session.
Soon. 
Sure, just write a module 
I actually think I've convinced myself I want to add some project library script hooks that run in the designer - I was thinking of things like running tests/linting, but it could probably be extended to cover this too.
I mulled that approach, too, but runInClient offers an effective superset of features possible. Just a bit of extra jython glue. Of particular note is that, like runScript, the designer's preview vs. design mode is ignored. As well as working without the need of a client message handler, which won't work in the designer at all.
This is trivial if you have the Vision module installed. Here's the approach I developed for adding functionality to my designer: Run script at designer startup
I use this for quite a few things that improve my design environment to include adding an icon button to the script editors and adding additional options to the tool bar dropdowns.
I'll have to test my runInClient decorator in the absence of Vision.
I considered going down the module path, but I want them to be accessible to more projects, and installing a module seemed less so given you need to restart the gateway to install them, and also restart all vision clients and designers. You might want to use them ad-hoc including on-site, so I settled on just a collection of script libraries.
I actually thought I'd seen this post before as I remembered you talking about dark mode around the same time. It'd be nice not to need vision installed, but this looks easy at least! I'll go with this method for now, cheers