# Gnome appindicator dns switcher
https://pypi.org/project/gnome-dns-switcher/
![](https://img.shields.io/github/v/tag/annervisser/gnome-dns-switcher?style=for-the-badge&logo=github&label=GitHub&link=https%3A%2F%2Fgithub.com%2Fannervisser%2Fgnome-dns-switcher)
![](https://img.shields.io/pypi/v/gnome-dns-switcher?style=for-the-badge&logo=python&logoColor=white&link=https%3A%2F%2Fpypi.org%2Fproject%2Fgnome-dns-switcher%2F)
Gnome appindicator (toolbar icon) tool to quickly switch between different DNS servers
- Easily available in your toolbox
- Config file to specify DNS servers
Supports multiple connections and switching them separately
- Utility button to restart NetworkManager
![Screenshot of menu with DNS servers](./screenshots/menu.png)
<details>
<summary>💻 More screenshots</summary>
#### Easily available in your toolbar
![](./screenshots/appindicator.png)
#### Shows you what it's done, no surprises
![](./screenshots/notification.png)
#### Supports multiple connections and switching them separately
![](./screenshots/menu_multiple_connections.png)
</details>
## Setup
Install dependencies
```shell
# If you don't yet have pip3:
sudo apt install python3-pip
# Install dependencies to run this application
sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-3.0 gir1.2-appindicator3-0.1
```
Install gnome-dns-switcher
```shell
# sudo so the script is added to $PATH, you can also install normally and fix $PATH :)
sudo pip3 install gnome-dns-switcher
# Generate a default configuration
gnome-dns-switcher generate-config
# Modify the config to your needs. See config documentation below
edit ~/.config/gnome-dns-switcher.yml
```
## Usage
### Start the app in the background
Simply add ` &` after your command
```shell
gnome-dns-switcher &
```
### Specify a different configuration file (default is `~/.config/gnome-dns-switcher.yml`)
```shell
gnome-dns-switcher --config /path/to/config.yml
```
### Add to startup applications
```shell
# Sleep 10 seconds before starting to prevent starting up
# before network connections have been made
bash -c 'sleep 10 && gnome-dns-switcher --config ~/.config/gnome-dns-switcher.yml'
```
## Config
The config file allows you to specify which DNS servers to show and what devices are visible.
By default, gnome-dns-switcher looks for a config file at `~/.config/gnome-dns-switcher.yml`
To generate and example configuration, you can run `gnome-dns-switcher generate-config`
### The generated configuration will look like this:
```yaml
servers: # DNS Server options to show
# DHCP is always shown as the first option
Quad9: 9.9.9.9
CloudFlare: [1.1.1.1, 1.0.0.1]
Google DNS:
- 8.8.8.8
- 8.8.4.4
devices: [] # Specify device names here if you want to hide certain devices (ip link show)
```
#### `servers` A list of servers that can be switched between
- The name is only used for displaying
- You can define one or more ips, as a yaml array or as a comma-seperated string
#### `devices` Which devices to show (optional)
- optional, will display all non-bridge connections if not present or empty
- one or more devices to show in the switcher
- List all your devices by running `ip link show` in a terminal
## Development
### Setup
Set up virtualenv:
```shell
virtualenv venv
source venv/bin/activate
```
Install dependencies:
```shell
python setup.py install
pip install vext vext.gi
```
### Running
```shell
python -m gnome_dns_switcher
```
### Useful links
- https://gjs-docs.gnome.org/
Raw data
{
"_id": null,
"home_page": "",
"name": "gnome-dns-switcher",
"maintainer": "Anner Visser",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "mail@annervisser.nl",
"keywords": "gnome,ubuntu,dns,appindicator",
"author": "Anner Visser",
"author_email": "mail@annervisser.nl",
"download_url": "https://files.pythonhosted.org/packages/6c/2f/524c66d2d324309af827b8858b168ea13fc3427f36c09ae251d3c3840efa/gnome-dns-switcher-1.3.0.tar.gz",
"platform": null,
"description": "# Gnome appindicator dns switcher\nhttps://pypi.org/project/gnome-dns-switcher/\n\n![](https://img.shields.io/github/v/tag/annervisser/gnome-dns-switcher?style=for-the-badge&logo=github&label=GitHub&link=https%3A%2F%2Fgithub.com%2Fannervisser%2Fgnome-dns-switcher)\n![](https://img.shields.io/pypi/v/gnome-dns-switcher?style=for-the-badge&logo=python&logoColor=white&link=https%3A%2F%2Fpypi.org%2Fproject%2Fgnome-dns-switcher%2F)\n\nGnome appindicator (toolbar icon) tool to quickly switch between different DNS servers\n- Easily available in your toolbox\n- Config file to specify DNS servers\nSupports multiple connections and switching them separately\n- Utility button to restart NetworkManager\n\n![Screenshot of menu with DNS servers](./screenshots/menu.png)\n\n<details>\n<summary>\ud83d\udcbb More screenshots</summary>\n\n#### Easily available in your toolbar\n![](./screenshots/appindicator.png)\n\n#### Shows you what it's done, no surprises\n![](./screenshots/notification.png)\n\n#### Supports multiple connections and switching them separately\n![](./screenshots/menu_multiple_connections.png)\n\n</details>\n\n## Setup\nInstall dependencies\n```shell\n# If you don't yet have pip3:\nsudo apt install python3-pip\n\n# Install dependencies to run this application\nsudo apt install python3-gi python3-gi-cairo gir1.2-gtk-3.0 gir1.2-appindicator3-0.1\n```\n\nInstall gnome-dns-switcher\n```shell\n# sudo so the script is added to $PATH, you can also install normally and fix $PATH :)\nsudo pip3 install gnome-dns-switcher\n\n# Generate a default configuration\ngnome-dns-switcher generate-config\n\n# Modify the config to your needs. See config documentation below\nedit ~/.config/gnome-dns-switcher.yml\n```\n\n## Usage\n### Start the app in the background\nSimply add ` &` after your command\n```shell\ngnome-dns-switcher &\n```\n\n### Specify a different configuration file (default is `~/.config/gnome-dns-switcher.yml`)\n```shell\ngnome-dns-switcher --config /path/to/config.yml\n```\n\n### Add to startup applications\n```shell\n# Sleep 10 seconds before starting to prevent starting up \n# before network connections have been made\nbash -c 'sleep 10 && gnome-dns-switcher --config ~/.config/gnome-dns-switcher.yml'\n```\n\n## Config\nThe config file allows you to specify which DNS servers to show and what devices are visible.\nBy default, gnome-dns-switcher looks for a config file at `~/.config/gnome-dns-switcher.yml`\n\nTo generate and example configuration, you can run `gnome-dns-switcher generate-config`\n### The generated configuration will look like this:\n```yaml\nservers: # DNS Server options to show\n # DHCP is always shown as the first option\n Quad9: 9.9.9.9\n CloudFlare: [1.1.1.1, 1.0.0.1]\n Google DNS:\n - 8.8.8.8\n - 8.8.4.4\ndevices: [] # Specify device names here if you want to hide certain devices (ip link show)\n```\n\n#### `servers` A list of servers that can be switched between\n- The name is only used for displaying\n- You can define one or more ips, as a yaml array or as a comma-seperated string\n\n#### `devices` Which devices to show (optional)\n- optional, will display all non-bridge connections if not present or empty\n- one or more devices to show in the switcher\n - List all your devices by running `ip link show` in a terminal\n\n## Development\n\n### Setup\nSet up virtualenv:\n```shell\nvirtualenv venv\nsource venv/bin/activate\n```\n\nInstall dependencies:\n```shell\npython setup.py install\npip install vext vext.gi\n```\n\n### Running\n```shell\npython -m gnome_dns_switcher\n```\n\n### Useful links\n\n- https://gjs-docs.gnome.org/\n\n\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "DNS Switcher for Ubuntu Gnome",
"version": "1.3.0",
"project_urls": {
"Issues": "https://github.com/annervisser/gnome-appindicator-dns-switcher/issues",
"Source": "https://github.com/annervisser/gnome-appindicator-dns-switcher/"
},
"split_keywords": [
"gnome",
"ubuntu",
"dns",
"appindicator"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f4564c6616fb3087b9bce11c4fa7cd9b833801e16d671980bfefa46e822961a3",
"md5": "c3fa96062833d3b12382838ffbb589fc",
"sha256": "0746427259de9ad18b7356347c08cd4ce8e27b21ef1b53219e67372d457e94cb"
},
"downloads": -1,
"filename": "gnome_dns_switcher-1.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c3fa96062833d3b12382838ffbb589fc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 21666,
"upload_time": "2023-06-25T12:05:34",
"upload_time_iso_8601": "2023-06-25T12:05:34.997193Z",
"url": "https://files.pythonhosted.org/packages/f4/56/4c6616fb3087b9bce11c4fa7cd9b833801e16d671980bfefa46e822961a3/gnome_dns_switcher-1.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6c2f524c66d2d324309af827b8858b168ea13fc3427f36c09ae251d3c3840efa",
"md5": "9c0ce4d3bfbbbe8c083e08f8d3fd5367",
"sha256": "ab342a2f30fdef884f95de44c88caf0c95b23373169564c62d8b8acce68b21ba"
},
"downloads": -1,
"filename": "gnome-dns-switcher-1.3.0.tar.gz",
"has_sig": false,
"md5_digest": "9c0ce4d3bfbbbe8c083e08f8d3fd5367",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 20991,
"upload_time": "2023-06-25T12:05:37",
"upload_time_iso_8601": "2023-06-25T12:05:37.124752Z",
"url": "https://files.pythonhosted.org/packages/6c/2f/524c66d2d324309af827b8858b168ea13fc3427f36c09ae251d3c3840efa/gnome-dns-switcher-1.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-25 12:05:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "annervisser",
"github_project": "gnome-appindicator-dns-switcher",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "gnome-dns-switcher"
}