I've spent this weekend mostly in bed, and on a PC watching memes
When I am at work and I see a customer or a colleague who needs some help I instantly conjure some motivation and can write some code... But when I'm alone at home I cannot accomplish anything on a computer, only can do the chores.
How do people even do anything on their own? I only became good at linux because I at some point in life became obsessed with it, I can't study anything on my own, couldn't get a driver's license, couldn't finish a university
You might want to look into ADHD and executive dysfunction in general. As a fellow ADHDr, I know the struggle is real. But there are ways to improve this, both behavioral and pharmacological.
Yes the “I can summon motivation magically if there are people around me” mirrors my own struggle.
Suffering from executive dysfunction obviates that there is no free will, and it's as if good health is simply having that illusion work out harmoniously.
When I used to have bigger gaps between contracts it would take about a month after finishing a job before I could do lots of coding on my own projects.
Went travelling for a bit and was working on my own projects and learning - it worked best when treating it a bit like an job, having a schedule to go and work in a coffeeshop pretty much.