systemctl hybrid-sleep or anything similar is, according to the manual, supposed to execute all scripts found in /lib/systemd/system-sleep and after that continue it's own execution.
Instead it completely and utterly ignores every single script I put in there:
gnome-terminal -e "touch Documents/qwert"
while [ 1 ]
do
echo hi
done
^ this should go in an infinite loop after creating a file. I've also tried things like touch /home/u/Documents/qwert etc.
I'm pretty puzzled actually. It might actually be caused by the fact that hybrid-sleep, hibernate, etc. all lead to a crash before complete execution, i.e. my laptop is unable to enter any kind of power saving mode and instead goes into a completely frozen state with a blank screen - however, it logs out before that and only crashes after a couple of seconds, so I assume the scripts should be executed just fine; after all those should be executed even before logging out.
touch /home/u/Documents/qwertwithoutgnome-terminal -echmod +x scriptname). 2. maybe add#! /bin/shas the first line of the script.#! /bin/shwas all that was needed. I've never had to use that before because I was starting all my scripts from the terminal. Thank you.