User Tools

Site Tools


systemd-resume

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

systemd-resume [2016/01/13 19:26]
ian created
systemd-resume [2020/02/13 22:55]
Line 1: Line 1:
-====== 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. 
- 
-<code> 
-[Unit] 
-Description=User 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 
-</code> 
- 
-Followed by enabling the service. 
- 
-<code> 
-# systemctl enable resume@ian 
-Created symlink from /etc/systemd/system/suspend.target.wants/[email protected] to /etc/systemd/system/[email protected]. 
-</code> 
- 
-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