I am running Ubuntu 20.04 LTS and is trying to set up my system so it will log in my single user automatically but employ a locked screensaver on startup to ensure security.
I have followed the solution here Automated login and screen lock and created the file ~/.config/autostart/screen_lock.desktop with the following contents:
[Desktop Entry]
Type=Application
Name=Lock Screensaver
Exec=gnome-screensaver-command -l
Upon startup I am logged in automatically but I get the desktop message: Unable to lock: Lock was blocked by an application
Running
gnome-screensaver-command -l
manually in the terminal works fine. I have looked in journalctl, but can only seem to find the same error as shown on the desktop: gnome-shell[1518]: error: Unable to lock: Lock was blocked by an application
Besides the screensaver I have im-launc and SSH Key Agent as startup applications, and I have some crontab jobs running a Python and a bash script, but this should all be background stuff and I can't figure out what is causing the problem. I can see other people have lock-screen problems with full-screen applications and virtual machines, but this is right on startup without (as far as I can tell) problematic applications running.
Any ideas to figure out what is causing the issue or workarounds?