My entire career as been driven, almost exclusively, by layoffs. I had been at my first job for about a year and was starting to think about moving on when my manager (who I think knew I was looking) told me that they were going to have to lay off a developer, and if I had an offer they'd rather I take it, otherwise they were going to have to let my co-worker go. I took the new job and moved cities to work at a start…
It's a bit risky because the first question you get when doing subsequent interviews is "Why have you been out of work so long?" I'd tell them I took time off and showed them the code I was working on. There would be some raised eyebrows, but to be honest, I think this actually helped filter out some companies that I really didn't want to work for. Indeed, had I took the initial job offer I received, I would have been out on the street again in 18 months (they laid everyone off...)
For me, anyway, this gave me a better sense of control at the expense of using up some of my retirement savings. Subsequently, I have had some management try to put the screws to me. It is freeing to be able to remind them (and myself!) that I'm only there because I choose to be.
I don't know if any of that will be useful to you, but I hope so.