Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

001-dnsswitcher.1d.sh: #2016

Open
everykindofpeople opened this issue Jan 9, 2024 · 5 comments
Open

001-dnsswitcher.1d.sh: #2016

everykindofpeople opened this issue Jan 9, 2024 · 5 comments

Comments

@everykindofpeople
Copy link

fao @saiqulhaq -
I'm new to this and not familiar with scripts. I want to be able to toggle between Control D dns service and Cloudflare from bar. How do I enable this plugin? Any help is appreciated. Thanks

@sprak3000
Copy link
Collaborator

@everykindofpeople

Looking at the plugin, you would need to edit the script as follows.

First, you need to define the list of DNS servers you want to use from Control D. Where you mention wanting to also use Cloudflare, look for this block in the script

# shellcheck disable=2034
cloudflare="1.1.1.1
            1.0.0.1"

and add your Control D IP addresses after it

# shellcheck disable=2034
cloudflare="1.1.1.1
            1.0.0.1"

# shellcheck disable=2034
controld="X.X.X.X
            Y.Y.Y.Y"

Where you just want these two, you want to change this line

enabled_dns_address=(cloudflare google level3 opendns norton default)

to be this

enabled_dns_address=(cloudflare controld default)

Once you have saved those changes, reload the plugin. Should see just Cloudflare and Control D servers as options.

@everykindofpeople
Copy link
Author

Thanks for the quick reply! That worked great to edit the server list. And now the plugin displays the current dns settings in xbar. But it doesn't change to a different server when I click on it in xbar. I'm running Sonoma 14.3, in case that has anything to do with it.

@saiqulhaq
Copy link
Contributor

I am not using this plugin anymore @everykindofpeople
FYI the DNS switcher utilizes networksetup command to change the DNS, you may read the documentation here https://www.unix.com/man-page/osx/8/networksetup/

networksetup -setdnsservers $network_service \$(echo \$dns_address)

I think you can try that it's still working fine with Sonoma or not by running the networksetup directly in your terminal, but try to close the Xbar app first.

This tutorial may helpful for you https://blog.kandji.io/managing-network-settings-on-macos-big-sur-and-mac-address-randomization-in-ios-14

@neoighodaro
Copy link

the commands generated themselves work from the tmp dir, just not through xbar

@neoighodaro
Copy link

heres how i fixed it, replace script echo

echo "$dns_name | refresh=true shell=bash param1=$switcher"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants