This tutorial shows how to automatically run custom command, script, or other actions after resuming your Linux PC/laptop from suspend or hibernate.
As you may know, there are quite a few ways to run something automatically at Ubuntu startup. You can use “Startup Applications” utility to run apps or custom commands at login, use crontab to schedule startup jobs, udev rules to auto-configure devices on detection, and systemd-tmpfiles service to auto create, delete, and write configuration files.
But what if your computer does not function properly, or some personal settings do not persist after waking up from sleep?
Without waiting for upstream fixes, you can workaround by creating custom systemd services, to auto-restart the function, or re-configure the settings, and trigger it automatically when waking up from sleep.