Run Script on Resume/Wakeup

Sorry, I have to revisit this. All the methods recommended have not worked for me. I am unsure where my error is after multiple attempts.

I have a Griffin Powemate that I use as an external volume control (don’t judge me). I want it to work after resuming from Standby/ Sleep. As it is now, I have to run a script from the command line to get it to to re-start. I am using Ubuntu 16.04 with Cinnamon Desktop

The Powermate will activate and control volume if I run any of these commands from the command line – if the machine is in sleep/standby

pmlogin.sh /usr/local/bin/powermate evrouter -c /etc/evrouterrc /dev/powermate powermate 

If I re-power the machine, it only works if I run “pmlogin.sh”

The scripts are:

/home/mspringer/bin/pmlogin.sh      #!/bin/sh     rm /tmp/.evrouter:0     /usr/local/bin/powermate  /usr/local/bin/powermate     #!/bin/sh     evrouter -c /etc/evrouterrc /dev/powermate 

contents of /etc/evrouterrc: Window “”

"Griffin PowerMate" "" any key/256 "XKey/XF86AudioMute" "Griffin PowerMate" "" any rel/7/1 "XKey/XF86AudioRaiseVolume" "Griffin PowerMate" "" any rel/7/-1 "XKey/XF86AudioLowerVolume" 

/dev/powermate is a link to /dev/input/event12 – the input from the Griffin Powermate.

The “/usr/local/bin/powermate” script is from the instructions I found to make it work. The pmlogin.sh was written by me because I had problems with the original script running after resume due to the existence of the /tmp/.evrouter:0 file.

I have followed every instruction that I could find, none of the methods have worked for me so far. Could someone please tell me what I am doing wrong or what will work? Just an FYI, I am not a total noob, I currently run/ maintain about 5 different Ubuntu installations and have been able to solve any problem I have had. This one I cannot resolve.

These are the basic methods I have followed, other links point me back to one or the other of these.

how to execute a command after resume from suspend? Make a script start after suspend in Ubuntu 15.04 (systemd) Run Script on Wakeup? How to run a script when suspending/resuming? – Sony VAIO Ubuntu 12.04