Ever since 2006 I have preferred Apple's MacBook Pro for its durability and the OS. However the last couple of models have had very little upgrades, the keyboard has become really bad and the OS is becoming more of a walled garden.
On my main desktop I run Linux as the main OS. So when it came time to choose a new laptop for my new job I took the chance to order a Linux based laptop. I chose the Dell XPS 13 (9380) Developer Edition. I could also have chosen a Purism or System76 device, but the purchasing process did not allow for those options.
So far I am very happy with the device. It is built well and comes preloaded with Ubuntu 18.04 LTS. I chose to keep the default OS on it, as it seems to provide the best experience.
On this page you will find some of the tweaks I had to do in order to make it work perfectly.
I found that the XPS 13 (9380) drains it battery while the lid is closed. This is highly annoying as I am one of those people that tends to work on the road a lot. Some research into the subject reveals that Linux has 2 hibernation modes.
Source for the below information: StackOverflow.
To verify which mode is active you run the command
cat /sys/power/mem_sleep. This will show you the following output.
s2idle. This mode basically boils down to "turn off the screen" instead of doing a full on hibernation. Obviously this will drain the battery.
This can be further verified by checking the logs after closing the lid, letting it go to sleep and waking it up. Run
sudo journalctl | grep "PM: suspend" | tail -2 in order to see how the kernel dealt with the suspension. You should see something like this.
May 13 18:41:00 mex kernel: PM: suspend entry (s2idle) May 13 20:52:36 mex kernel: PM: suspend exit
To test the
deep sleep setting (I highly recommend you test it before using it) you can toggle the setting by running
echo deep > /sys/power/mem_sleep as the root user. Verifying
cat /sys/power/mem_sleep should show you:
When you let your machine go to sleep now you can verify the logs to see the kernel did the right thing now (
sudo journalctl | grep "PM: suspend" | tail -2):
May 13 18:41:00 mex kernel: PM: suspend entry (deep) May 13 20:52:36 mex kernel: PM: suspend exit
To permanently fix this issue you need to change the GRUB configuration. Open up the default configuration using
sudo -H gedit /etc/default/grub and change the following line:
You will need to add the
mem_sleep_default profile to it, as shown below.
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mem_sleep_default=deep"
Now you just need to recreate the active GRUB config by running the following command:
sudo grub-mkconfig -o /boot/grub/grub.cfg
Your laptop should now go into deep hibernation whenever you close your lid, as it should.