Laptop randomly goes to sleep every 15 seconds

In the last couple weeks, I’ve had a few random incidents where I would open my laptop, use it for about 15 seconds, and it would randomly go to sleep. When I turn it back on, it would go back to sleep after another 15 seconds or so. I can only break the cycle if I power down my laptop all the way or type sudo reboot in the terminal before the 15 seconds is up.

Following the reboot, a KWin crash handler window appears saying KWin has unexpectedly closed. I don’t think it’s the same application crashing every time, but I can’t remember which apps crashed the first couple times this happened. I usually have Vivaldi, Ghostty, and Razer Settings open and those haven’t had a KWin crash. I think it’s been a text editor or IDE that crashed so far.

I have also noticed that this has only happened when my laptop isn’t plugged in, and it’s on battery. That could just be a coincidence, but there are settings for my laptop to go to sleep after a few minutes when on battery, so it’s possible it could be related.

This isn’t a big deal since I can just reboot to make the problem temporarily go away, but it’s a little annoying, and I don’t even know where to start troubleshooting it. Any help or advice is appreciated.

Thanks!

Create new user, logout from the current user’s session, then login as the newly created user. This will tell you that:

  • If the issue persists, it is a system issue
  • If the new user does not see the issue, it’s a configuration in your user’s homedir