0

I'm learning Rust and trying to connect to wifi networks through the code. But, when I try to connect to a network with an incorrect password, I receive the default GNOME connect pop-up, like if I'm trying to connect manually. How can I disable this pop-up? I'm using wifi-rs 0.2.2 and the example code to connect. I use Pop!_OS 22.04 with GNOME 42.5.

here's the code:



match wifi.connect(&ssid, &password) {
    Ok(result) => println!(
        "{}",
        if result == true {
            "Connection Successful."
        } else {
            "Invalid password."
        }
    ),
    Err(err) => println!("The following error occurred: {:?}", err),
}
kelsny
  • 23,009
  • 3
  • 19
  • 48
zap
  • 9
  • 1
  • This could help: https://developer-old.gnome.org/NetworkManager/stable/nmcli.html – Solomon Ucko Mar 16 '23 at 02:35
  • 1
    This wifi-rs crate does nothing more than executing `nmcli device wifi connect password ifname wlan0` command for you. – tla Mar 16 '23 at 21:48
  • 1
    Tried nmcli directly on the console and the pop-up appeared again. Apparently it's a default Pop!_OS feature, but I didn't found how to disable that... Thank you for the help! – zap Mar 18 '23 at 02:33

0 Answers0