I recently installed Ubunutu 18.04 in a rather old laptop I have, and am having some major issues with the device going to sleep and then getting stuck in a loop where it goes to sleep every five seconds once woken up. It is a Lenovo G555-0873, and if it works great and fine when coming up after a fresh reboot, but if it ever sleeps, then it gets stuck constantly trying to sleep and is incredibly difficult to troubleshoot because I have to complete every interaction in the ~5 seconds I have before it sleeps again. I've tried disabling it from going to sleep at all by changing the following settings:
In Privacy, I've turned off Screen Lock
In Power, I've turned off "Dim screen while inactive", set "Blank screen" to never, and turned off "Automatic suspend"
I can't find any other settings that seem like they would effect this sort of thing. Per an old thread on a similar issue, I've also run the following command:
None of this has seemingly had any effect. The laptop still goes to sleep when left idle, and then proceeds to enter it's strange sleep-loop when brought back up, and loops like that until eventually rebooted. Any assistance or suggestions are appreciated.
~edit~ I've determined now that it only happens when the lid of the laptop is shut. If I leave it with the lid open and the laptop idle it never goes to sleep, but it still sleeps instantly once I shut the lid (and then begins the hell of sleep-looping after waking up).