GithubHelp home page GithubHelp logo

dark-mode's Introduction

Dark Mode

Package for Atom Editor which allow you to switch to dark mode and light mode theme automatically thanks to your Mac light sensor.

Installation

Run: apm install dark-mode or use Atom Package Manager in Atom settings.

** After installation remember to restart Atom or run Window: Reload in command palette.**

Manual Theme switcher

Dark Mode

To change theme manually use:

ctrl + `

or in command palette choose Dark Mode: Toggle

Auto mode

By activating auto mode you will take an advantage of implemented sensors to switch the theme automatically.

To disable/enable auto mode choose in command palette: Dark Mode: Turn On Auto mode or Dark Mode: Turn Off Auto Mode

Sun Sensor

Based on DAY or NIGHT atom will change theme automatically.

System Theme Sensor

Not working until Atom will upgrade to Electron 3.0 but we are already all set :) Based on your system's theme atom will adjust the theme automatically.

Ambient Light Sensor

Not working until Atom will enable chrome's sensors.api by default

It will change your theme based on your ambient light sensor of your computer (if present and supported)

You can setup the interval of refreshing and threshold of darkness level in the package settings.

Customization

Go to the package config in Atom settings.

You can specify your own custom theme for each mode and use it as a fast theme switcher.

dark-mode's People

Contributors

exelord avatar vinkla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dark-mode's Issues

Uncaught TypeError: Cannot read property 'cancel' of undefined

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.45.0 x64
Electron: 4.2.7
OS: Mac OS X 10.15.5
Thrown From: dark-mode package 4.0.2

Stack Trace

Uncaught TypeError: Cannot read property 'cancel' of undefined

At /Users/DrodMantras/.atom/packages/dark-mode/lib/sensors/sun.js:37

TypeError: Cannot read property 'cancel' of undefined
    at _default.deactivate (/packages/dark-mode/lib/sensors/sun.js:37:20)
    at _default.deactivateSensor (/packages/dark-mode/lib/sensors/sensor.js:137:12)
    at /packages/dark-mode/lib/dark-mode.js:85:79
    at Array.forEach (<anonymous>)
    at Object._setSensorsState (/packages/dark-mode/lib/dark-mode.js:85:18)
    at /packages/dark-mode/lib/dark-mode.js:75:12
    at emitter.on (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:334653)
    at Function.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1214120)
    at Emitter.emit (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1215561)
    at Config.emitChangeEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:337141)
    at Config.setRawValue (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:334381)
    at Config.set (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:330175)
    at Object._toggle (/packages/dark-mode/lib/dark-mode.js:94:17)
    at HTMLElement.darkModeToggle (/packages/dark-mode/lib/dark-mode.js:67:38)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:349290)
    at Object.didConfirmSelection (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:699460)
    at SelectListView.confirmSelection (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:875983)
    at HTMLDivElement.core:confirm (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:870862)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:349290)
    at KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1254747)
    at KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1250881)
    at WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:284496)

Commands

     -0:17.4.0 command-palette:toggle (input#dark-mode.ambientLightSensor.input-checkbox)
 13x -0:15 core:backspace (input.hidden-input)
     -0:13.2.0 core:confirm (input.hidden-input)
     -0:13.1.0 dark-mode:toggle (input#dark-mode.ambientLightSensor.input-checkbox)

Non-Core Packages

acode-ui 0.1.5 
atom-html-preview 0.2.6 
atom-ide-ui 0.13.0 
atom-material-syntax 1.0.8 
atom-material-ui 2.1.3 
autocomplete-clang 0.13.1 
build 0.70.0 
build-cargo 2.0.0 
busy-signal 2.0.1 
code-dark-ui 0.8.0 
dark-flat-ui-mxml 1.3.0 
dark-mode 4.0.2 
dracula-night-syntax 0.5.0 
dracula-ui 0.6.0 
file-icons 2.1.40 
genesis-ui 0.5.0 
gpp 0.4.3 
gpp-compiler 3.0.7 
ide-rust 0.21.2 
intentions 1.1.5 
jsartisan-dark-minimalistic-ui 2.4.0 
language-ini 1.23.0 
linter 2.3.1 
linter-gcc2 0.8.8 
linter-ui-default 1.8.1 
mac-os-ui 0.3.0 
macos-mojave-syntax 0.4.0 
native-ui 0.27.0 
nil-syntax 0.1.0 
nil-ui 0.2.0 
nv-dark-syntax 1.4.1 
nv-dark-ui 3.0.8 
platformio-ide 2.6.0 
platformio-ide-debugger 1.2.6 
platformio-ide-terminal 2.10.0 
seti-ui 1.11.0 
tool-bar 1.3.0 
xcode-dark-syntax 0.2.0 
xcode-midnight-dark-syntax 0.2.0 
xcode-theme 2.0.0 

Randomly toggles

I'm using the system sensor on macOS Sierra and am currently on light mode, but Atom switches to dark mode a minute or so after enabling the package. The other sensors and the hotkey are disabled.

Auto change doesn't works in my configuration

@Exelord thank you for implementing this, I've looked to way how I can get access from light sensor in js :)

Does it work in current Mac OS? looks like we don't have access to sensor now, is it right?

I have macbook pro 2016:
Atom: 1.23.3 x64
mac os 10.13.3

Info notification appear on each new window

Whenever I open a new window the Dark Mode: Automatic mode is: ON/OFF notification appears in the top right corner. Due to how fast the notification is closing I'm guessing this isn't the expected behaviour.

Below is an example:

screen recording 2018-10-23 at 13 18 18

I'm guessing it has something todo with the following code:

registerCallbacks() {
this.subscriptions.add(atom.config.onDidChange('dark-mode.ambientLight', ({newValue}) => {
this.ambientLight.active = newValue;
atom.notifications.addInfo(`Dark Mode: Automatic mode is ${newValue ? 'ON' : 'OFF'}`, notificationsOptions);
}));
this.subscriptions.add(atom.config.onDidChange('dark-mode.ambientLightThreshold', ({newValue}) => {
this.ambientLight.threshold = newValue;
}));
},

Let me know if there is any other information I can provide.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.