- C 81.7%
- Shell 9.4%
- Python 7.2%
- Makefile 1.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| fonts | ||
| helper | ||
| src | ||
| tests | ||
| .gitignore | ||
| charnetwork.desktop.in | ||
| charnetwork.svg | ||
| desktop.sh | ||
| Makefile | ||
| README.md | ||
| run.sh | ||
| setup.sh | ||
charnetwork
A small network switcher for Linux (dhcpcd + wpa_supplicant). It lists your Ethernet, USB tethering and Wi-Fi connections and lets you pick which one carries traffic.
- Shows each connection's address, IPv4/IPv6 gateways and live up/down speed
- Use sends traffic through one connection and keeps the others connected
- Only uses one connection and disconnects the others, once it is ready
- Off / On and All off / All on bring connections down or up
Written in C with SDL3, OpenGL 3.3 and FreeType.
Dependencies
To build: a C compiler, make, pkg-config and the development files for SDL3, FreeType and libpng. On Void:
sudo xbps-install base-devel pkg-config SDL3-devel freetype-devel libpng-devel
To run: ip (iproute2), iw, dhcpcd, and pkexec (polkit) with a polkit agent for the password prompt.
Build
./setup.sh
This checks for the libraries and runs make.
Run
./run.sh
| Key | Action |
|---|---|
↓ ↑ / j k |
Select a connection |
Space |
On / off |
u |
Use |
o |
Only |
r |
Refresh |
q / Esc |
Quit |
Changing connections needs root, so the app runs helper/charnetwork-helper through pkexec and your polkit agent asks for your password.
run.sh builds the app if needed and keeps anything it writes in .data/. Virtual interfaces (bridges, containers) are hidden; CHARNETWORK_ALL=1 ./run.sh shows them.
Install
Add charnetwork to your app launcher:
./desktop.sh --link
Optional: to type the password once every few minutes instead of for every change, install the helper and a polkit policy (uses sudo):
./setup.sh --system # install
./setup.sh --remove # remove again
These are the only files charnetwork puts outside its folder:
/usr/local/libexec/charnetwork-helper
/usr/share/polkit-1/actions/org.charnetwork.helper.policy
The installed helper is used only while it matches helper/charnetwork-helper exactly, so rerun --system after changing it.
Tests
make test
Needs Python 3. The helper runs against faked commands and the app runs without a window, so the tests never touch your network.
Bundled fonts are Noto Sans and Noto Serif (SIL Open Font License); the license is in fonts/.