Resume after suspend black screen (nvidia, artix, nvidia-utils, elogind)

If you use artix linux, have a nvidia card and use the suspend feature, do this if you get a black screen after resume from suspend.

1. Fix

Edit /etc/elogind/system-sleep/nvidia and /lib/elogind/system-sleep/nvidia and change it to this:

#!/bin/sh

case "$1" in
    pre)
        /usr/bin/nvidia-sleep.sh "suspend"
        sleep 2
        ;;

    post)
        (sleep 2; /usr/bin/nvidia-sleep.sh "resume";)&
        ;;
esac

1.1. File not found or similar

If you can’t find the file try looking for a similar one in other path, probably it’s there and it’s what is causing the bug, you just have to find it.

2. Debug

If something goes wrong, ssh into your machine while you have the black screen and try dmesg to find something interesting.