If you are on a Mac, I've built auto-focus.app which uses macOS's do not disturb feature when you are "in flow". It detects your work apps and triggers DnD after some time.