What you are doing is "self-limiting" which is not very effective. The devil on your shoulder will always fight this - "don't tell me what to do!"
The wanting to not doom-scroll should be intrinsic. I know that right now, for obvious reasons, it's easier said than done.
For me, it is, but I would still automatically open Reddit or Twitter when compiling code, and then get stuck in a loop of looking at interesting and/or annoying stuff.
The solution was easy, though, I just put all of these sites, Facebook, Reddit, Twitter, Instagram, etc. into my hosts file and pointed them to localhost. It took about a week for this automatic behavior to stop. Instead, I have a language learning app, so now I go through some flashcards while my code compiles.
Or open news.ycombinator.com. Maybe the next addition to my hosts file.
15 minutes on HN, then I'm out even if I still have a Chrome limit.
It's really interesting that we have to resort to little jails like this to get our attention back.
Choice and opportunity-cost is all "self-limiting", the only difference is perspective. It's better to have an additive-mindset, i.e. replace a habit with another that provides value rather than merely focusing on restricting something. This works for everything, including diet. In the words of Allan Carr, if you view your actions as sacrifice, you won't succeed.
a) Make your feeds more worthy and less attention grabbing by blocking anything that isn't one of your specific interests.
b) If you make good use of your time, you'll find doing stuff more interesting than scrolling.
I've written about this too: https://thisisjam.es/reflecting/on-information-diets/
I do think having your phone in another room helps tremendously. I fight every morning to not take my phone into the bathroom for my morning ritual and waste 15-20 minutes of dooms scrolling.