Is there a program similar to this for ubuntu https://play.google.com/store/apps/details?id=tomka.lockmyphone ?
This app locks the phone for selected periods of time during selected intervals.
Or is there a shell script already out there? I'm not sure how shell scripts work.
I searched this forum and found brainbreak. But it seems to be defunct now.
=== EDIT ===
The solution should be such that it can't be circumvented and locks the screen for sure for a predetermined amount of time at predetermined intervals.