Not sure if you want advice, but maybe you could carry around a small notebook? Or if that’s too inconvenient, write notes in your phone. Then if inspiration strikes you can get it down in the moment.
For me at least, this always boiled down to memory and not being inspired when I’m not busy.
Can you make yourself a really minimal computer that you use only for writing, that only has a word processor and doesn’t have any other distractions on it?
There are a couple mantras from Anne Lamott’s book on writing, Bird by Bird, that I repeat to myself when feeling anxious or stuck or easily distracted. One is, short assignments. The other is, shitty first drafts. For me, they help remind me to just write something. Don’t worry about finishing the book, the chapter, even a page. Write a sentence. And don’t worry about whether it’s any good.