Fedora broken and unusuable after sleep

Hi,
I use a early 2016 retina Macbook (1,2 Ghz intel core m5, 8go ram, 500go ssd, intel HD graphics 515 1536 mo). Tired of MacOS and soon to end support, I wanted to switch to Linux.
I failed with Ubuntu, Fedora, openSUSE, Mint, you name it.

I encounter the same major problem with each distro: after sleep, the system is broken, buggy, and I have to go for a hard reboot.
On Ubuntu, I couldnt even log back in. With Fedora, I can re-open my session but nothing works. Apps wont open, some icons wont load, buttons do nothing, and then, crash.

I tried a few tweaks found online but as far as I know, nobody seems to have found a solution, so nothing worked for me.
I was told it might be Wayland, so I chose to run Gnome on Xorg on the loggin screen. I didnt work (absolutely no change except now the trackpad lost a few functions like 3 fingers swap).

I also read on github about compatibility and they mention some macbooks need the line:
echo 0 > /sys/bus/pci/devices/0000:01:00.0/d3cold_allowed
to work after sleep. I dont really understand if I have to type this at each startup or just when the computer is coming back from sleep.

So, is this a lost cause on this machine ? Is there a workaround I havent heard of ? Am I doing it wrong with Xorg ?
Can I maybe disable or change drivers ?
Also I dont want to just shut display and go without sleep mode, I’d run out of battery in a couple hours.

Thanks for your help !

OK, the trick with the command line from github seems to kinda work for now. But will I have to type time I boot ? Can I make it automatic in some way ? (I am a total beginner, dont know about this.)
Thanks !

To execute this command at startup, follow these steps:

  • Make a script file startup.sh containing the following:

      #!/bin/bash
      echo 0 > /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed
    
  • place it in /usr/local/bin/

  • make it executable with chmod +x /usr/local/bin/startup.sh

  • make a Systemd Service file in /etc/systemd/system/ called startup.service containing the following:

      [Unit]
      Description=Startup Script
    
      [Service]
      ExecStart=/path/to/startup.sh
    
      [Install]
      WantedBy=multi-user.target
    
  • Enable and start the service:

      sudo systemctl daemon-reload
      sudo systemctl enable startup.service
      sudo systemctl start startup.service