2.3 KiB
2.3 KiB
netbird-hooks
GNOME Shell extension (GNOME 50): enforces netbird connectivity while you are on an open (unencrypted) wifi, with a configurable trusted-networks exemption list. Trusted or WPA-secured networks are never touched; netbird is never brought down.
How it works
- A tiny systemd user service (
netbird-hooks.service, written and started by the extension) watches NetworkManager vianmcli monitorand runs the policy check on every connection change. No root anywhere. - On each event the policy re-reads its config from gsettings
(
org.gnome.shell.extensions.netbird-hooks), so preference changes apply on the next network event without restarting anything. - Policy: enforcement enabled AND the connected device is wifi AND the wifi
is open AND the SSID is not on the trusted list AND netbird is not already
connected ->
netbird up(netbird's own default/auto exit selection). - Every trigger is logged:
journalctl -t netbird-hooks. - A panel indicator shows the live netbird state (green = connected, red = down), refreshed on network events and every 15s. Clicking it opens a menu with a "NetBird settings" entry that opens the preferences.
The GUI
Extensions app -> "NetBird Hooks" -> gear:
- Enforce netbird on open wifi — master switch
- Show panel indicator — toggle the top-bar icon
- Trusted networks — SSIDs where netbird is never enforced; add by typing or via "Add current network", remove per row
Equivalent CLI:
gsettings set org.gnome.shell.extensions.netbird-hooks enforce false
gsettings set org.gnome.shell.extensions.netbird-hooks trusted-ssids "['my-cafe']"
Install
make install
then log out and back in (the extension + indicator load on the next session; the user service can also be started standalone, see below), and enable:
gnome-extensions enable netbird-hooks@netz.org
Manual service start without the extension (the unit is written by the extension's enable(); a static copy works too):
systemctl --user enable --now netbird-hooks.service
Files
netbird-policy.sh— the watcher loop;netbird-policy.sh onceruns a single policy check (handy for testing)schemas/— gsettings schema (compiled bymake)extension.js/prefs.js— shell integration + preferences UI