index : nmrs-tui
A fast, Vim-friendly NetworkManager TUI built in Rust.
about summary refs log tree commit diff

Diffstat (limited to 'src/nm/client.rs')

-rw-r--r-- src/nm/client.rs 25
 1 file changed, 25 deletions(-)

diff --git a/src/nm/client.rs b/src/nm/client.rs
deleted file mode 100644
index 43aab44..0000000 100644
--- a/src/nm/client.rs
+++ /dev/null
@@ -1,25 +1,0 @@
use anyhow::Result;
use zbus::{Connection, Proxy};

pub struct NmClient {
    pub connection: Connection,
    pub proxy: Proxy<'static>,
}

impl NmClient {
    pub async fn new() -> Result<Self> {
        // Connect to system D-Bus
        let connection = Connection::system().await?;

        // Create NetworkManager proxy
        let proxy = Proxy::new(
            &connection,
            "org.freedesktop.NetworkManager",
            "/org/freedesktop/NetworkManager",
            "org.freedesktop.NetworkManager",
        )
        .await?;

        Ok(Self { connection, proxy })
    }
}