That's what I'm also recommending and working more/less reliably in terms of locking.
One thing which I'm also analysing recently is electron shit^H^H^Happs, triggering XSS (X screen saver) idle detection on some internal app events (not user actions!).
Being: if you dont move mouse, nor touch keyboard, plus you're receiving slack messages, XSS considers youre NOT idle, in result not allowing lock to work if relying on xss-idle-detection.
needing it as I'm expermineting with some cool X11 software from 199x. I added XSS support, as original detection engine(*) dont work reliably on modern X11.
But yeah, one of those things that's surprisingly tricky to get right.