قالب وردپرس درنا توس
Home / Tips and Tricks / Make your iPhone switch wallpaper automatically when dark mode or light mode is on «iOS & iPhone :: Gadget Hacks

Make your iPhone switch wallpaper automatically when dark mode or light mode is on «iOS & iPhone :: Gadget Hacks



There are still live wallpapers on your iPhone that can turn dark when dark mode is active or light when light mode is on, but there’s no easy way to do the same for custom wallpapers. That doesn’t mean you’re out of luck, though, as you can use Shortcuts to build a workaround until Apple gives us an official “Dark Mode” option for automation.

While we wait for that official “dark mode” trigger, which may never come, we can build an automation that checks if dark mode or light mode is currently on and runs a shortcut that tells iOS to change the background of your home and lock the screen to the image you chose for dark mode or light mode, whichever is set. The trigger can be for a specific time of day, whenever you open an app or even when you leave your home.

Requirements

First, you need the Shortcuts app, which is necessary for every shortcut. It comes pre-installed on iOS 1

3 and above, but if you uninstalled it, you can reinstall it from the App Store. Second, the “Add untrusted shortcuts” switch must be turned on in Settings -> Shortcuts if it isn’t already. Finally, you have to use iOS 14 or higher on your iPhone. Some of the actions shown in the shortcut we are using are not available in iOS 13 so it will only work if you are using the latest iOS version.

Step 1: Add the shortcut

The “Light or Dark Wallpaper” shortcut, from RoutineHub user poll, is available for free download from the direct iCloud link below. You can also get it from the dedicated RoutineHub page, where the shortcut is routinely updated (at the time of writing it is version 1.1).

After clicking “Get Shortcut”, the Shortcuts app should open with a preview of the “Light or Dark Background” shortcut. Here you can view the actions of the workflow and tap “Add untrusted shortcut” at the bottom to add it to your library.

Step 2: Find photos and create two albums

Before running the shortcut, you need to find two photos that will show as wallpaper when dark mode is on and off. You can find dark / light mode wallpapers online that use different shades, and you can even use two photos you took yourself. They can be anything you want, be it the same image with different colors or two completely different photos. For this example, I’m using some official Big Sur wallpapers.

Next, you need to create two separate albums for each photo in Photos app. Open the Photos app and find the first of your two photos. Tap the Share button at the bottom left, then tap “Add to album” in the Share sheet.

To create a new album, tap the empty “New album …” option at the top and enter a name for your album. If it is the wallpaper you want to display when night mode is off, we recommend “Day” or “Light”. Use “Dark” or “Night” for the background in dark mode. The album names should be something simple and sweet, but you can use whatever you want. When you’re done naming the album, tap Save.

Do this for both photos you want to use as the background using the shortcut, so you have two albums: one for light mode images and one for dark mode images. Below you can see both of my albums in the Photos app.

Step 3: Configure the shortcut

The only tweak you need to make to the shortcut you downloaded is to add the day and night albums you created to the actions. In Shortcuts, on the “My Shortcuts” tab, tap the ellipsis (•••) on the card for “Light and Dark Background”. This will take you to the shortcut editor.

Then go to the first Photos action box, under the “Light mode is on” action box, and tap “Recent”, the album chosen by default. Scroll down here and find the Day of Light album you created and choose it. When dark mode is off (ie, light mode is on), the photo in this album becomes your background.

Now scroll down a bit further and go to the second photo action box below Different, then tap Recent next to Album Is. This time, choose the Dark or Night album you created. This is the background that will be displayed when night mode is on.

Step 4: Create an automation

Unfortunately, the shortcut cannot be linked directly to the dark mode that is enabled, which means that if you enable the dark mode, the background will not automatically change in the background. For that to happen, Apple must add a “Dark Mode” option to the list of automation triggers. Instead, when the shortcut is running, it checks whether dark mode is on or not, then changes the background accordingly.

So we will have to create an automation to run the shortcut in the background as it is cumbersome to tap on it every time you want to switch backgrounds. If you keep dark mode on and off all day, it’s best to use the shortcut when opening an app you use often. To do this, tap “Automation” in Shortcuts, then “Create Personal Automation” (tap the plus sign (+) first if you don’t see it).

Then choose the trigger to run the shortcut. If you’ve set the dark mode appearance on a schedule, you’d better use the “Time of Day” trigger, where the shortcut will run at sunrise, sunset, or some other time. Just match the timing to that of your release schedule.

For my example, I’m using the ‘App’ trigger. If you choose to, choose your app (I select Twitter), leave “Is Opened” checked, and tap “Next” to create the rest of the automation.

Tap “Add action” and type “run shortcut” in the text box. An option called “Run Shortcut” should appear below Actions – tap it.

Once the Run the shortcut action appears, tap “Shortcut” and select “Light or dark background” from the options that appear. Then click “Next” at the top right.

Finally, turn off “Ask Before Running” so that the shortcut can run in the background when you open the app you specified. Click on “Don’t ask” and tap on “Done” to complete your automation.

Step 5: Run the shortcut in the background

Now switch to and from dark mode as usual. While your background doesn’t change immediately, it will every time you open the app you chose in the automation. You can even open the app as soon as you enter or exit dark mode so it’s a quick change to the background. But again, if you have dark mode on a schedule, it is better to use the “Time of day” trigger to match it.

The first time you run the Light or Dark Background shortcut, you will be prompted to grant the shortcut access to the Photos app so it can create the wallpapers. After that, the change will take place in the background without you having to do anything else, and the wallpaper will change on your lock screen as well as on the home screen. Below is the background in action when dark mode is on (left) and off (right).

Keep your connection safe without a monthly bill. Get a lifetime subscription to VPN Unlimited for all your devices with a one-time purchase from the new Gadget Hacks Shop, and watch Hulu or Netflix with no regional restrictions, increase security when browsing public networks and more.

Buy now (80% discount)>

Cover photo, screenshots and GIFs from Nelson Aguilar / Gadget Hacks

Source link