Sleep issues on my Razer Blade Stealth. 16.04 LTS

So I have decided to make the leap from Windows to Linux, but I have been having one issue. Whenever I close the lid of my laptop, it goes into sleep mode, and when I open the lid, it comes back awake. My issue is, that 30 seconds or a minute into use, it auto goes into sleep for NO reason, I don't know why it does this. I then have to press the power button to get it to wake, but then it just repeats, I have to completely power off to fix it. Any solutions? I can provide info as needed, provided you tell me how to get that info.


Solution 1:

Editing the grub boot parameters as suggested here did the job for me (on 16.10)

  1. Open a terminal and run

    gksudo gedit /etc/default/grub
    

    which will open a texteditor

  2. Search for GRUB_CMDLINE_LINUX_DEFAULT = "" (which was empty in my case) and change it to

    GRUB_CMDLINE_LINUX_DEFAULT="button.lid_init_state=open"
    
  3. Save and close gedit

  4. update grub with the following command in the terminal

    sudo update-grub
    
  5. Restart