Network
Wrapper library over networkmanager to better integrate with Astal.
Installation
- install dependencies
sh
sudo pacman -Syu meson vala libnm gobject-introspection
sh
sudo dnf install meson gcc valac NetworkManager-libnm-devel gobject-introspection-devel
sh
sudo apt install meson valac libnm-dev gobject-introspection
- clone repo
sh
git clone https://github.com/aylur/astal.git
cd astal/lib/network
- install
sh
meson setup build
meson install -C build
TIP
Most distros recommend manual installs in /usr/local
, which is what meson
defaults to. If you want to install to /usr
instead which most package managers do, set the prefix
option:
sh
meson setup --prefix /usr build
Usage
You can browse the Network reference.
CLI
There is no CLI for this library, use the one provided by networkmanager.
sh
nmcli --help
Library
js
import Network from "gi://AstalNetwork"
const network = Network.get_default()
print(network.wifi.ssid)
py
from gi.repository import AstalNetwork as Network
network = Network.get_default()
print(network.get_wifi().get_ssid())
lua
local Network = require("lgi").require("AstalNetwork")
local network = Network.get_default()
print(network.wifi.ssid)
vala
// Not yet documented