[Unit] Description=[ThinkPad Yoga] Rotation with accelerometer Requires=display-manager.service After=display-manager.service [Service] Type=simple ExecStart=/usr/bin/env python2 /opt/thinkpad-x380-yoga-scripts/rotate/thinkpad-rotate.py KillMode=process User=%i Environment="DISPLAY=:0" "XAUTHORITY=/home/%i/.Xauthority" Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target