Glass half full vs glass half empty. The hedonic treadmill has nothing to do with it. It's about being thankful and making the best of things. That's the antidote.
However you look at it being a programmer in today's society has the potential to give you an amount of choice and wealth enjoyed by very few other industries. You can make your own luck by simply being motivated enough to learn, and the initial outlay to create a massively profitable business is tiny compared to many other fields. So make the best of it. You could work for 3 months a year and do what you love for the other 9.
Are you really telling me you can't make that work? It is about perspective.