dotfiles/.config/systemd/user/autolock.service

13 lines
302 B
Desktop File

[Unit]
Description = Lock the screen when the last smart card is removed
PartOf = smartcard.target
[Service]
Type=oneshot
RemainAfterExit = yes
ExecStart = swaymsg output '*' dpms on
ExecStop = sh -c "loginctl lock-session; sleep 1; swaymsg output '*' dpms off"
[Install]
WantedBy = smartcard.target