Notes - GNU/Linux (desktop)

Return to note list
Run a command on resume using systemd

This is based upon an example from the Arch Linux wiki.

Create the following systemd service file at /etc/systemd/system/resume@.service:

Description=Resume actions for user %I

ExecStart=/usr/bin/env sudo -u %i /home/%i/bin/resumeAutostart


Then enable it for your user systemctl enable resume@**username**.service. You must enable it for each user you want to be able to run something on resume. Then the script ~/bin/resumeAutostart will be run on resume.