Skip to main content

Power Saving Mode on Linux

About a year and a half ago, I bought a new notebook. This time I chose a Dell, because some of their models are even Linux-certified. Since I also use a Dell notebook at work and had Linux running on it for a long time, I knew I couldn’t really go wrong with a Dell.

And indeed, everything basically worked smoothly from the start. A few small adjustments here and there – as usual. However, after some time I noticed one difference: when I put the system into power saving mode (Suspend-to-RAM), it eventually wakes up on its own and stays awake. This is of course extremely inconvenient, as the battery drains quickly and the notebook also heats up. But even if it doesn’t wake up by itself, the power consumption is still noticeably higher.

My old notebook supported the Deep Sleep ACPI mode S3, which allowed me to keep it in power saving mode for weeks at a time. Unfortunately, my Dell no longer supports this mode, like many other notebook models. Instead, it uses Modern Standby.

Deep Sleep originated in the 1990s, dominated for decades and also worked reliably under Linux. However, the market was driven by the development of smartphones and tablets with Always-Connected features, as known from iOS and Android. Microsoft then introduced Modern Standby, also to enable background updates. As a result, many hardware manufacturers increasingly rely on this standard only – probably also to save costs.

Nothing you can do about it.

To prevent the battery from completely draining when the notebook is in my backpack, I wrote two small shell scripts. They ensure that when the notebook wakes up unintentionally from power saving mode, it quickly goes back to sleep. Intentional waking is signaled by pressing the CTRL key.

The first script smartsleep.sh is executed during system suspension and wake-up:

  • Logs system states (entering/leaving power saving mode)
  • Determines the state of the laptop lid and connected docking station
  • Waits for CTRL key press during wake-up
  • Controls the daemon via signals (USR1/USR2)

The second script smartsleepd runs in the background and handles the wake-up logic:

  • Receives signals from smartsleep.sh
  • Goes back to sleep if no CTRL key was pressed
Mastodon