If youโre anything like me, you enjoy changing between dark mode and light mode based on what vibe youโre feeling.
Hereโs a quick and to-the-point tutorial where I'll show you how to add a shortcut to your MacBook's Touch Bar that makes switching all that much easier.
๐๐
What we'll be doing
Very simply, weโll be creating an Automator script that allows us to create a shortcut for dark/light mode. Once we have the script set up, we will add a Touch Bar shortcut to make switching between the two modes easier.
If you're not familiar with any of these things, don't worry as I've listed each step with helpful screenshots to guide you. We've got this!
What youโll need:
- MacBook w/Touch Bar ๐๐ฝ๐ป
- macOS Mojave
Step 1)
Create the script that automates the light โ dark mode process
โ Open Automater
โ Create a New document
โ Create a quick action, and then click "Choose"
Step 2)
Implementing the script
Change the workflow selection to "no input"
Change the image to your desired icon. This will appear on the Touch Bar. I selected the color wheel.
In the Actions search bar type "Run AppleScript"
Double click "Run AppleScript" and youโll see this page
Delete the existing code, and replace it with the following code:
tell application "System Events"
tell appearance preferences
set dark mode to not dark mode
end tell
end tell
It should look like this:
Let's test out the script by clicking the "Run" button
Switch back to the โlight mode by clicking "Run" again.
Let's go ahead and save the script. I named mine โDark Mode Toggleโ
Step 3)
Creating the Touch Bar shortcut. Weโre almost there!
On System Preferences โ Extensions, make sure the Dark Mode Toggle is checked
Click on Customize Control Strip
This will take you to this page, where you can drag your quick action to your desired location on the keyboard. I chose to put mine on the far right.
Note: you'll have to drag it towards the desired place on your Touch Bar. See more here.
Congratulations, you did it! ๐
Connect with me on Twitter @oiHamza. ๐จ๐ฝโ๐
Top comments (0)