It's FOSS - https://itsfoss.com/ubuntu-close-lid-suspend/
Brief: You close the lid of your laptop but it keeps on running instead of going into suspend mode? Here are a few ways how you can make Ubuntu suspend when the lid is closed.
One of the ways to save battery on Ubuntu without losing work is to use the suspend mode. I prefer to link with the lid action of my laptop. If I close the lid of the laptop, it goes to suspend/sleep mode and when I open the lid, it wakes up.
However, there are several users who are facing issues with suspend behavior when the lid