Mac turn dark mode on or off using terminal command


Toggle Dark mode on off using Mac Terminal Command
Toggle Dark mode on off using Mac Terminal Command

If you with to turn Dark Mode on/off on your Mac using macOS Terminal command you can do that using dark-mode package.

  1. Make sure you have brew installed - if not follow the tutorial to install it - link
  2. Install package dark-mode using command: brew install dark-mode
    % brew install dark-mode
    Running `brew update --preinstall`...
    ==> Auto-updated Homebrew!
    Updated Homebrew from 51da118a9 to 374adf7f1.
    Updated 2 taps (homebrew/core and homebrew/cask).
    
    Pouring dark-mode--3.0.2.arm64_monterey.bottle.tar.gz
    🍺  /opt/homebrew/Cellar/dark-mode/3.0.2: 5 files, 93KB
    ==> `brew cleanup` has not been run in the last 30 days, running now...
  3. To turn on Dark Mode type: dark-mode on in Terminal
  4. To turn off Dark Mode type: dark-mode off in Terminal

Note: When the first time you run the command using the dark-mode package you will be asked to provide access to System Events.

“Terminal“ wants access to control “System Events“. 
Allowing control will provide access to documents and data in “System Events“, 
and to perform actions within that app.

Source: https://github.com/sindresorhus/dark-mode

% dark-mode --help

  Usage
    $ dark-mode [command]

  Commands
      Toggle dark mode
    on      Enable dark mode
    off     Disable dark mode
    status  Dark mode status

  Created by Sindre Sorhus
Advertisements
Try Out Code2care Dev Tools:

Advertisements



#Android #Java #Linux #Microsoft #Google #Python #MacOS #Notepad++ #Microsoft Teams #CSS #PHP #SharePoint #Html #Linux #C-Program #Bootstrap #jQuery #Sublime #Android-Studio #Facebook #Eclipse #WhatsApp #News #MySQL #Json #HowTos #JavaScript #FTP #S3


Advertisements


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Tutorials, Trouble-Shooting steps, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.
🎉 We are celebrating the 10th years of Code2care! Thank you for all your support! We hope we made a difference.
We strong support Gender Equality & Diversity.

We stand in solidarity with Ukraine - Make a donation to UNHCR - https://donate.unhcr.org/in/en-in/ukraine-emergency