The nvidia package supplies some shell scripts to help with putting the device into sleep mode.
case "$1" in
pre)
logger -t nvidia-sleep "Entering $2 mode (invoked by $SYSTEMD_SLEEP_ACTION)"
/usr/bin/nvidia-sleep.sh "hibernate"
ret=$?
if [ $ret -ne 0 ]; then
logger -t nvidia-sleep "Failed to enter $2 mode (exit code $ret)"
exit $ret
fi
sleep 5
logger -t nvidia-sleep "Entered $2 mode (invoked by $SYSTEMD_SLEEP_ACTION)"
;;
First, the script ignores the argument completely and always passes hibernate, when it could accept suspend via "$2" as well. I'm not sure if it causes issues, but it looks wrong.
Second thing, the unnecessary sleep for 5 seconds slowing the whole thing down for no reason whatsoever. I just removed that line and nothing broke. ZZZ hook doesn't have the wait time, so I don't think it's doing anything, plus it returns if we succeeded anyway.
The nvidia package supplies some shell scripts to help with putting the device into sleep mode.
First, the script ignores the argument completely and always passes hibernate, when it could accept suspend via "$2" as well. I'm not sure if it causes issues, but it looks wrong.
Second thing, the unnecessary sleep for 5 seconds slowing the whole thing down for no reason whatsoever. I just removed that line and nothing broke. ZZZ hook doesn't have the wait time, so I don't think it's doing anything, plus it returns if we succeeded anyway.