Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Enable Dark Mode on macOS

In this article, we will explore how to enable Dark Mode on macOS, a feature that enhances the visual experience by reducing eye strain and saving battery life on devices with OLED screens. Dark Mode is particularly useful for users who work in low-light environments or prefer a darker interface. This guide will cover the steps to enable Dark Mode through the System Preferences and via command line for advanced users.

Examples:

Enabling Dark Mode via System Preferences

  1. Open System Preferences:

    • Click on the Apple menu in the top-left corner of the screen.
    • Select "System Preferences" from the dropdown menu.
  2. Navigate to General Settings:

    • In the System Preferences window, click on "General."
  3. Select Dark Mode:

    • Under the "Appearance" section, you will see three options: Light, Dark, and Auto.
    • Select "Dark" to immediately switch to Dark Mode.
    • Alternatively, you can select "Auto" to automatically switch between Light and Dark Mode based on the time of day.

Enabling Dark Mode via Command Line

For users who prefer using the Terminal, Dark Mode can also be enabled via command line:

  1. Open Terminal:

    • You can find Terminal in the Applications > Utilities folder or by searching for it using Spotlight (Cmd + Space and type "Terminal").
  2. Enter the Command:

    • To enable Dark Mode, type the following command and press Enter:
      osascript -e 'tell application "System Events" to tell appearance preferences to set dark mode to true'
    • To switch back to Light Mode, use the following command:
      osascript -e 'tell application "System Events" to tell appearance preferences to set dark mode to false'
  3. Verify the Change:

    • Your macOS interface should immediately switch to Dark Mode upon executing the command.

Automating Dark Mode with a Script

For users who want to automate the switching between Dark and Light Mode, you can create a simple shell script:

  1. Create the Script:

    • Open Terminal and create a new script file:
      nano toggle_dark_mode.sh
  2. Add the Script Content:

    • Copy and paste the following script into the file:
      #!/bin/bash
      current_mode=$(osascript -e 'tell application "System Events" to tell appearance preferences to get dark mode')
      if [ "$current_mode" = "true" ]; then
      osascript -e 'tell application "System Events" to tell appearance preferences to set dark mode to false'
      else
      osascript -e 'tell application "System Events" to tell appearance preferences to set dark mode to true'
      fi
  3. Save and Exit:

    • Save the file by pressing Ctrl + X, then Y, and Enter.
  4. Make the Script Executable:

    • Run the following command to make the script executable:
      chmod +x toggle_dark_mode.sh
  5. Run the Script:

    • Execute the script to toggle Dark Mode:
      ./toggle_dark_mode.sh

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.