Return from suspend gurus?

fixit7

Member
Joined
Mar 4, 2019
Messages
63
Reaction score
18
Credits
55
Are there any gurus who know a lot about running a command after a computer resumes from suspending?
 


Define a little more, Mate - are we talking scripting, or executing a command from a file already in existence, or other?

I can move this to Command Line, if you think it will help.

Cheers

Chris Turner
wizardfromoz
 
I am trying to get a script to run after my computer has returned from a suspend state.

This is not working.

#!/bin/sh
#
# Created 3/31/19 in /usr/lib/systemd/system-sleep/
if [ "${1}" = "pre" ]; then
# Do the thing you want before suspend here
echo "we are suspending at $(date)..." > /home/andy/Downloads/systemd_suspend_test
elif [ "${1}" = "post" ]; then
# Do the thing you want after resume here
echo "...and we are back from $(date)" >> /home/andy/Downloads/systemd_suspend_test
/usr/bin/gxmessage -fg red -font 'sans 30' -timeout 3 ' Computer has now resumed from suspend state.'
fi
 
Thanks for that, @fixit7 , I'll move this to Command Line.

Good luck

Wizard
 

Members online


Top