From macOS Mojave and higher version, instead of waiting for your Mac to automatically switch between Dark Mode and Light Mode, there are times we need to adjust it manually. You will need to head to System Preference > General and then convert from Dark to light, which is quite time consuming.
If you are using a MacBook Pro and you are looking for a way to switch Dark Mode easily right on the Touch Bar, this guide will show you how to create a Dark Mode on / off button directly on the Touch Bar so that you can switch the mode more easily.
Steps to Create a Dark Mode switch on MacBook Pro
Step 1: First of all, you need to bring the Quick Action key to the Touch Bar. To do so, head to System Preference -> Extensions and then scroll down to Touch Bar. From there, choose Customize Control Strip
Step 2: You will see buttons appearing on Touch Bar. Simply drag and drop Quick Actions icon into Touch Bar
Step 3: Now, open Automator app, you can press Command + space and enter Automator to open it more quickly.
Step 4: From Automator window, click on File > New and select Quick Actions icon.
Step 5: From Quick Actions screen, choose run AppleScript on the left side
Step 6: You will then be asked to type in an Applescrip code. Copy and paste it into “*Your Script Goes here*”.
on run input, parameters
tell application "System Events"
tell appearance preferences
set dark mode to not dark mode
Step 7: After pasting it, you will see the image below:
Step 8: Whne done, run AppleScrip at the top right screen
That’s it! If it automatically switches to Dark Mode, you have been successful. Then, save the Automator and rename it into Dark Mode or any name. from now, every time you press on Quick Button, it will automatically change to Dark Mode.