master
1[Unit]
2Description=Lock the screen automatically after a timeout.
3Requires=graphical.target
4After=graphical.target
5
6[Service]
7Type=simple
8User=ubuntu
9Environment=DISPLAY=:0
10ExecStart=/usr/bin/xautolock -time 10 -locker "systemctl suspend" -detectsleep
11
12[Install]
13WantedBy=graphical.target