<ul dir="auto">
<li>Electron version: 1.4.4</li>
<li>Operating system: elementary OS Loki (basically Ubuntu 16.04)</li>
</ul>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="app.on('ready', () =&gt; {

    const powerMonitor = require('electron').powerMonitor;

    powerMonitor.on('suspend', () =&gt; {
        console.log('SUSPEND');
    });
});"><pre class="notranslate"><span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'ready'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>

    <span class="pl-k">const</span> <span class="pl-s1">powerMonitor</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'electron'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">powerMonitor</span><span class="pl-kos">;</span>

    <span class="pl-s1">powerMonitor</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'suspend'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
        <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'SUSPEND'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">does not output anything. Works fine on Windows.</p>
<p dir="auto">So I have a very simple code on a working app, but in no way does the event ever get trigged.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="app.on('ready', function() {
  require('power-monitor').on('on-battery', function () {
    console.log('battery time');
  });
});"><pre class="notranslate"><code class="notranslate">app.on('ready', function() {
  require('power-monitor').on('on-battery', function () {
    console.log('battery time');
  });
});
</code></pre></div>
<p dir="auto">(The app itself is larger than that, ofc, I just cropped he useful part.</p>