[Unit]
Description=Lock the screen automatically after a timeout.
Requires=graphical.target
After=graphical.target

[Service]
Type=simple
User=ubuntu
Environment=DISPLAY=:0
ExecStart=/usr/bin/xautolock -time 10 -locker "systemctl suspend" -detectsleep

[Install]
WantedBy=graphical.target
