I have a custom script (uses $DISPLAY) for setting up the extra buttons on my mouse. I want to run this script every time I log into the system. I have added the script as a Startup Application via the Ubuntu (18.10) GUI (Gnome 3.30.1). It runs after I turn on my PC or reboot it, but fails to run after the PC resumes from sleep.
How can I make the script run after the PC resumes from sleep? (Preferably without having to maintain a separate script).
man pm-action
to see how to add a script to Suspend/Resume/Sleep/Wake. You'll have to hard-code the value of$DISPLAY
, and considerxhost +localhost
to give the script access to your X windows – waltinator Nov 15 '18 at 17:34systemctl suspend
to goto sleep. How can I configure it to run a custom script after I login? – Naximus Nov 15 '18 at 19:19