aboutsummaryrefslogtreecommitdiffstats
path: root/roles/_workstation/sleep/templates/user-sleep@.service.j2
blob: 34d404d80e7d5eeee2d591c7f38a67d796454a20 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# managed by Ansible

[Unit]
Description=sleep.target of a systemd user session
Before=suspend.target sleep.target hibernate.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl --user start suspend.target
ExecStop=/usr/bin/systemctl --user stop suspend.target
User=%I
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/bus
RemainAfterExit=yes

[Install]
WantedBy=suspend.target sleep.target hibernate.target
remember that computers suck.