User Tools

Site Tools


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/[email protected] with the commands to run automatically.

Description=%I resume actions

ExecStartPre=/usr/bin/xset -display :0 dpms force off
ExecStart=/usr/bin/xset -display :0 dpms force on


Followed by enabling the service.

# systemctl enable [email protected]
Created symlink from /etc/systemd/system/[email protected] to /etc/systemd/system/[email protected]

Now when the laptop resumes from sleep, the xset commands are run for me.

systemd-resume.txt · Last modified: 2020/02/13 22:55 (external edit)

free spam filter