====== systemd Suspend Resume Hook ======
On my laptop, the connected external monitor does not come out of sleep unless I run ''xset dpms force off''. Since this annoys me, I was looking to run this command automatically on every resume.
I found that I was able to create the file ''/etc/systemd/system/resume@ian.service'' with the commands to run automatically.
[Unit]
Description=%I resume actions
After=suspend.target
[Service]
User=%I
Type=simple
ExecStartPre=/usr/bin/xset -display :0 dpms force off
ExecStart=/usr/bin/xset -display :0 dpms force on
[Install]
WantedBy=suspend.target
Followed by enabling the service.
# systemctl enable resume@ian
Created symlink from /etc/systemd/system/suspend.target.wants/resume@ian.service to /etc/systemd/system/resume@ian.service.
Now when the laptop resumes from sleep, the xset commands are run for me.