Skip to content

Instantly share code, notes, and snippets.

@icve
Created July 31, 2018 07:27
Show Gist options
  • Select an option

  • Save icve/c9f4eceb0b74492a789d710641631339 to your computer and use it in GitHub Desktop.

Select an option

Save icve/c9f4eceb0b74492a789d710641631339 to your computer and use it in GitHub Desktop.
LightDM Suspend hook (systemd)
[Unit]
Description=User suspend lightDM lock screen
Before=sleep.target
[Service]
User=%I
Environment=DISPLAY=:0
Environment=XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
ExecStart=/usr/bin/dm-tool lock
ExecStartPost=/usr/bin/sleep 1
[Install]
WantedBy=sleep.target
# 1. copy file into /etc/systemd/system/suspend\@.service
# 2. run sudo systemctl enable suspend@<username>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment