How to use the @sindresorhus/do-not-disturb.disable function in @sindresorhus/do-not-disturb

To help you get started, we’ve selected a few @sindresorhus/do-not-disturb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sindresorhus / do-not-disturb-cli / cli.js View on Github external
(async () => {
	switch (command) {
		case 'on':
			await doNotDisturb.enable();
			break;
		case 'off':
			await doNotDisturb.disable();
			break;
		case 'toggle':
			await doNotDisturb.toggle();
			break;
		case 'status':
			console.log(await doNotDisturb.isEnabled() ? 'on' : 'off');
			break;
		default:
			cli.showHelp();
	}
})();
github wulkano / kap / main / common / aperture.js View on Github external
const cleanup = () => {
  const {
    hideDesktopIcons,
    doNotDisturb
  } = lastUsedSettings;

  closeAllCroppers();
  resetTray();

  if (hideDesktopIcons) {
    desktopIcons.show();
  }

  if (doNotDisturb && !wasDoNotDisturbAlreadyEnabled) {
    dnd.disable();
  }

  setCropperShortcutAction();
};
github wulkano / kap / app / src / renderer / js / main.js View on Github external
const stopRecording = async () => {
    ipcRenderer.send('will-stop-recording');

    const filePath = await aperture.stopRecording();

    if (app.kap.settings.get('hideDesktopIcons')) {
      desktopIcons.show();
    }

    if (app.kap.settings.get('doNotDisturb') && !wasDoNotDisturbAlreadyEnabled) {
      doNotDisturb.disable();
    }

    ipcRenderer.send('stopped-recording');
    ipcRenderer.send('open-editor-window', {filePath});
    setMainWindowSize();
  };

@sindresorhus/do-not-disturb

Control the macOS `Do Not Disturb` feature

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis