Toggle VPN through on Home Screen (one click for enable/disable)

Through this shortcut, you will be able to Enable/Disable VPN through one click from the Home Screen. (Link at bottom)

I’m not sure if this has been done earlier, but I’ve had a tough time finding an option to work for my use. I hope this is helpful to someone who needs it. You can club this setup with opening apps under automation to make it easier for you.

Requirements:

  1. Actions app by Sindre Sorhus (the savior):
    https://apps.apple.com/us/app/actions/id1586435171

Shortcut Setup:

Link to shortcut: https://www.icloud.com/shortcuts/7de0abcfb80148148927ac997975b1fc
Download the Actions app before using this link.

Limitations:
This will not work if the Actions app is unable to detect your VPN. Most VPNs work, however.

there is literally an action “Toggle VPN” in Shortcuts, no need to use the app Actions. Here is my Toggle VPN Shortcut - just one action:

You don’t need to check if connected to VPN. Tap where it says Connect / Disconnect and set it to Toggle.

I don‘t want to rely on another app. To check if I am connected to my home network, I check my IP:

Not failproof though. I also tried sending a Get call towards my router, but I can‘t set the timeout for the call so it is not useful :frowning:

Owl-VPN has widgets

This is what I was looking for without needing another app! Thanks for the tip.

Can confirm. Now, how to add this as a control center toggle?

For whatever reason, that often does not work always for me. Takes 2-3 iterations for it to work at times.

I use a vpn connection shortcut with a location based focus automation btw. If I am not at home enable VPN and vice versa. To be sure I’ll get a notification whether I am or not connected to VPN.

Use a wait command for 5-10 seconds since VPN needs a bit time for to connect. Disconnecting should be immediately though.

Ah this tracks! Thanks kind stranger