No description
  • C 81.7%
  • Shell 9.4%
  • Python 7.2%
  • Makefile 1.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
charlotte 3ba7606485 Rewrite charnetwork in C
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 23:03:50 +02:00
fonts Rewrite charnetwork in C 2026-10-08 23:03:50 +02:00
helper Initial commit 2026-10-08 22:45:40 +02:00
src Rewrite charnetwork in C 2026-10-08 23:03:50 +02:00
tests Rewrite charnetwork in C 2026-10-08 23:03:50 +02:00
.gitignore Rewrite charnetwork in C 2026-10-08 23:03:50 +02:00
charnetwork.desktop.in Initial commit 2026-10-08 22:45:40 +02:00
charnetwork.svg Initial commit 2026-10-08 22:45:40 +02:00
desktop.sh Rewrite charnetwork in C 2026-10-08 23:03:50 +02:00
Makefile Rewrite charnetwork in C 2026-10-08 23:03:50 +02:00
README.md Rewrite charnetwork in C 2026-10-08 23:03:50 +02:00
run.sh Rewrite charnetwork in C 2026-10-08 23:03:50 +02:00
setup.sh Rewrite charnetwork in C 2026-10-08 23:03:50 +02:00

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/.