exelord / dark-mode Goto Github PK
View Code? Open in Web Editor NEWPackage for Atom Editor which allows you to switch to dark mode and light mode theme.
License: MIT License
Package for Atom Editor which allows you to switch to dark mode and light mode theme.
License: MIT License
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:
I'm guessing it has something todo with the following code:
Lines 56 to 65 in 872dde7
Let me know if there is any other information I can provide.
Many people use something to cover their laptop cameras when not in use, e.g. https://supporters.eff.org/shop/laptop-camera-cover-set
For such people, checking the ambient light is not possible because the camera is covered up most of the time. It would be nice to have a second mechanism to trigger automatic changes based on system time and sunset information.
What do you think?
@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
[Enter steps to reproduce:]
Atom: 1.45.0 x64
Electron: 4.2.7
OS: Mac OS X 10.15.5
Thrown From: dark-mode package 4.0.2
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)
-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)
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
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.
Switch with system dark mode.
macOS v. 10.15 Catalina
Atom v. 1.40.1
dark-mode v.4.0.2
Package settings:
Auto Mode ✔️
System Theme Sensor ✔️
If I toggle Dark mode manually in the macOS settings the dark-mode package doesn't change the theme of the Atom editor.
Edit: https://github.com/paysonwallach/mojave-dark-mode works with Catalina.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.