try {
    const { stdout } = execa.sync('pmset', ['-g', 'batt']);

    return stdout.indexOf('Battery Power') !== -1;
  } catch (ex) {