After issues with Windows, I decided to try out Linux. On Windows, when I close the lid, the fan turns off and can be placed in my backpack. Opening the lid, it quickly resumes where it left off. I am trying to recreate this functionality.
Currently, the screen shuts off, but the power light and fan is still on, leading to overheating if placed in a backpack
To fix this, I tried sudo vim /etc/systemd/logind.confuncommenting:
HandleSuspendKey=suspend
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspendand restarting.
Online, I learned that suspend is still using power, but I am unaware if turning off the display and suspend is the same thing (If the laptop is actually suspending).
To check this, I changed the power button functionality to suspend, but only a hard-reset could turn on the display after this. I know there are issues with this, but if I can't have my backpack in suspend mode in my backpack, I might be looking at different functionality.
Do you know if there is similar functionality to the Windows 'sleep on lid closed' functionality? Is setting up hibernate what I'm looking for?
My laptop is an HP envy x360 convertible 13-ar0802
Edit: My Ubuntu version is 18.04.4 I googled power management and downloaded an app through Ubuntu Software which has a setting for when the lid is closed. It is set to suspend. Under settings - power - Suspend and power button, I only have two options, one for automatic suspend (on for both plugged and unplugged after 20 min), and when power button is pressed, power off
Edit: I notice that the screen is at 0% brightness when it wakes from WinKey → Suspend → Enter. Running a video with audio in the background will resume once awoken, but no display, and I am unable to login (I think. I cant see anything, but pressing enter and my password repeatedly does nothing)
Edit:Update on cat /sys/power/mem_sleep
4 Answers
Does your laptop have dedicated Nvidia GPU? If yes then turning off the hybrid graphics will help.
0You better use the power button to put your laptop to sleep.
I've noticed that the Suspend when laptop lid is closed option in Tweaks doesn't seem to have the expected behavior for some laptops. So, if you close the lid, it actually just turns off the screen, instead of putting the laptop to sleep.
So, manually suspend your laptop just to be sure.
Okay, so I had the same issue with my laptop with Ubuntu 20. The reasons for this can vary so I can only say that diagnosing why it's happening helped me greatly. What I did later to solve it was just my own improvisation from various sources and my basic skills.
I found from Ubuntu forums that using the dmesg terminal command could give me clues as to why it isn't suspending. Using this I found that my touchpad (presuming the drivers?) was preventing suspend on looking up what the logs dmesg gave meant. Among the numerous entries, this caught my eye:
[ 1601.148777] psmouse serio3: Failed to disable mouse on rmi4-01.fn03/serio0I then tried commands removing my touchpad drivers (commands mentioned below) and then closed my lid. I was so sure it was the problem because my cursor didn't work properly after opening my lid during any failed suspend.
It worked then. At this point, I could manually run those add/remove commands in the terminal manually each time whenever I chose to suspend.
I then improvised and made a systemd service on lid close/open (here's one answer which helped) which ran bash scripts that removed my touchpad drivers and put them back, respectively. The scripts just had the commands to remove/put them back.
The commands for removing/adding the touchpad are:
rmmod psmouse //remove
modprobe psmouse //put backThey need sudo if running as a user, systemd runs it as root by default if you remove the username parameter.
Worked then!
So this is how I did it and can only emphasise the importance of my first point of diagnosing why. The problems causing it despite everything seemingly fine must be case-by-case/device-to-device.
2 1