Giter Club home page Giter Club logo

dark-mode's Introduction

dark-mode

Control the macOS dark mode from the command-line

Requires macOS 10.10 or later. macOS 10.13 or earlier needs to download the Swift runtime support libraries.

Install

$ brew install dark-mode
$ npm install --global dark-mode-cli
Manually

Download the binary and put it in /usr/local/bin.

Usage

$ dark-mode --help

  Usage
    $ dark-mode [command]

  Commands
    <none>  Toggle dark mode
    on      Enable dark mode
    off     Disable dark mode
    status  Dark mode status

Build

Run ./build. The binary can be found at ./bin/dark-mode.

Building in Xcode works, but it does not export a binary.

Related

dark-mode's People

Stargazers

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

Watchers

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

dark-mode's Issues

illegal hardware instruction

I get the following error message:

$ dark-mode status
fatal error: unexpectedly found nil while unwrapping an Optional value
Current stack trace:
0    dark-mode                          0x0000000106f52b20 swift_reportError + 132
1    dark-mode                          0x0000000106f6fed0 _swift_stdlib_reportFatalError + 61
2    dark-mode                          0x0000000106cddc90 specialized specialized StaticString.withUTF8Buffer<A> ((UnsafeBufferPointer<UInt8>) -> A) -> A + 355
3    dark-mode                          0x0000000106edff00 partial apply for (_fatalErrorMessage(StaticString, StaticString, StaticString, UInt, flags : UInt32) -> Never).(closure #2) + 109
4    dark-mode                          0x0000000106cddc90 specialized specialized StaticString.withUTF8Buffer<A> ((UnsafeBufferPointer<UInt8>) -> A) -> A + 355
5    dark-mode                          0x0000000106e9a880 specialized _fatalErrorMessage(StaticString, StaticString, StaticString, UInt, flags : UInt32) -> Never + 96
6    dark-mode                          0x0000000106c36d60 static DarkMode.isDark.getter + 334
7    dark-mode                          0x0000000106c376d0 main + 1450
8    libdyld.dylib                      0x00007fffeafa1234 start + 1
zsh: illegal hardware instruction  dark-mode status
$ dark-mode --version
2.0.1

The program takes a few minutes to produce the error message. dark-mode on also takes several minutes to run but doesn't produce any output and doesn't enable dark mode. Everything worked fine yesterday.

Menu Bar not changed on 10.12

dark-mode seems incapable of changing the Menu Bar's theme in 10.12 Public Beta. The tool runs successfully and reports no errors that I can see, but only the Dock is changed to dark mode.

Set appearance to auto?

The CLI usage could be dark-mode auto.

The dark mode in the appearance preferences object is boolean. Seems it's impossible to set appearance to auto with a simple AppleScript.

I found a discussion at https://macscripter.net/viewtopic.php?id=48730.

But if there is any other way to set appearance to auto, it would be a great feature.

Version 3.0 is incompatible with MacOS Versions lower than 10.14

I guess you already know about this and it was an intentional decision but the readme still states that dark-mode works with MacOS 10.10 or later.
Running on 10.13.6 (because my work machine does not support Mojave) I get the following error every time I run brew upgrade:

dark-mode: macOS Mojave or newer is required.
Error: dark-mode: An unsatisfied requirement failed this build

If this was unintentional I would really appreciate a fix since I quite enjoy using dark-mode especially because it's not officially supported on my mac. If it was not, I can submit a PR to change the readme if you want me to and try to find an alternate solution.

Update: I read #16 (which I obviously should've before submitting this) and now know that this was semi-intentional. I sadly don't know enough about xcode to know if it is possible to fix this though.

Fatal error: Unexpectedly found nil while unwrapping an Optional value

Issuehunt badges

$ dark-mode status
Fatal error: Unexpectedly found nil while unwrapping an Optional value

Subsequently, kill -9 is unable to terminate the process.

macOS 10.14.5.


IssueHunt Summary

Backers (Total: $40.00)

Become a backer now!

Or submit a pull request to get the deposits!

Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

New release

The latest released version does not compile with Xcode 11 (because of the swift version used). Could you release a new version so we can ship it in Homebrew?

Use of this app?

This package is certainly functional, but it performs a single highly-specific task and no more. I found it in awesome-nodejs(the author of awesome-nodejs is also the author of this package, interestingly).
Does this package demonstrate something highly interesting? Am I missing something?

Thanks.

Error: missing return in a function expected to return 'String?'

Build with macOS Mojave 10.14.6 on MBP 2017

Last 15 lines from /Users/mufeng/Library/Logs/Homebrew/dark-mode/01.build:
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~
/tmp/dark-mode-20191209-84518-17xuhso/dark-mode-3.0.0/Sources/DarkMode.swift:9:3: error: missing return in a function expected to return 'Bool'
                }
                ^
/tmp/dark-mode-20191209-84518-17xuhso/dark-mode-3.0.0/Sources/util.swift:6:1: error: missing return in a function expected to return 'String?'
}

Dark-mode breaks menu-bar

When installing dark-mode via homebrew on a brand new macOS 10.12.3 installation, the menu-bar breaks.

Only the dock turns dark when activating dark-mode, and confirmed that using the system preference pane to do so (prior to install) works fine. After installing dark-mode, using the system pref UI will ONLY turn the menu-bar dark, and will no longer control the dock.

A complete uninstall does not solve this problem.

dark-mode left my system in a mixed state

After playing around with dark-mode, it left my system in a mixed-mode state. The menubar is dark, but the backgrounds for the Dock and the Cmd-Tab display are light.

This mixed-state persists no matter what I do in System Preferences. It also persists after full reboots.

package.json

i see you published this to npm but there's no package.json here.

Declined Authorization nsapplescript

I had declined the Authorization for editing system preference from the terminal, which prompted after I first time run the dark-mode.

After some searching and looking around, I think it was linked to nsapplescript. But I don't know how to fix it or to regenerate that prompt.

I was using MacOS Mojave 10.14 (18A391)

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.