[Unit]
Description=Lock X session
Before=sleep.target

[Service]
User=simon
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/local/bin/lock

[Install]
WantedBy=sleep.target