Has anyone been able to use crontab
to lock their screen automatically? I have tried all the suggested methods here but none seems to work. I have an Ubuntu 20.04 gnome desktop and even the Screen Lock in the settings does not work. Only the following command works via the terminal:
gnome-screensaver-command -l
Here is the current code block accessed by sudo crontab -e
:
SHELL=/bin/bash
0 /1 * * systemctl restart network-manager
0 /1 * * systemctl restart teamviewerd
/2 * * * gnome-screensaver-command -l