From 4ef1da0a1514fb2bc1bbe184e231394815a5d051 Mon Sep 17 00:00:00 2001 From: santoshxshrestha Date: Mon, 29 Dec 2025 23:59:04 +0545 Subject: [PATCH 01/10] refresh listner for saved connections --- CHANGELOG.md | 11 ++++++++ README.md | 44 ++++++++++++++++++++++++++++++- src/apps/core/saved_connection.rs | 8 ++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..580df46 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [Unreleased] +- (future changes go here) + +## [0.1.0] – Working State +- Initial project structure and working TUI +- Basic network scanning, connecting, and disconnecting via NetworkManager (`nmcli`) +- Just a learning project, not production-ready! diff --git a/README.md b/README.md index e0a7c01..972fabd 100644 --- a/README.md +++ b/README.md @@ -1 +1,43 @@ -wrapper around cli +# nmtui + +A Terminal UI (TUI) for NetworkManager, built in Rust as a simple wrapper around `nmcli`. + +> **Learning project:** This app was created mainly for learning Rust, exploring TUI design, and experimenting with how terminal applications work. It’s not meant to be super polished or perfect-just a fun side project! + +## What’s this? + +It’s basically a text-based network manager for your Linux system (using NetworkManager), controlled from your terminal-like `nmtui`, but home-brewed. You can: + +- See available wifi networks +- Connect/disconnect networks +- Manage saved connections +- See current status-all in your terminal + +## How do I use it? + +### Build + +You’ll need Rust (https://rustup.rs), then run: + +``` +cargo build --release +``` + +### Run + +``` +cargo run +``` + +...or run the compiled binary from `target/release/nmtui`. + +## Notes + +- Only tested on Linux (with NetworkManager installed) +- Some features might be a bit rough-pull requests & feedback are welcome! + +## License + +MIT (see LICENSE) + +--- diff --git a/src/apps/core/saved_connection.rs b/src/apps/core/saved_connection.rs index 3ff0a8c..c4f1474 100644 --- a/src/apps/core/saved_connection.rs +++ b/src/apps/core/saved_connection.rs @@ -134,6 +134,14 @@ impl App { }) => { self.show_help = true; } + Event::Key(KeyEvent { + code: event::KeyCode::Char('r'), + kind: event::KeyEventKind::Press, + modifiers: event::KeyModifiers::CONTROL, + .. + }) => { + self.saved_connection.fetch_saved_connections(); + } _ => {} }; } From 191454d1ee182f5b473eb071262ea1452b7878d6 Mon Sep 17 00:00:00 2001 From: santoshxshrestha Date: Tue, 30 Dec 2025 00:01:00 +0545 Subject: [PATCH 02/10] docs fix --- src/apps/core/saved_connection.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/core/saved_connection.rs b/src/apps/core/saved_connection.rs index c4f1474..6bb48ac 100644 --- a/src/apps/core/saved_connection.rs +++ b/src/apps/core/saved_connection.rs @@ -88,7 +88,7 @@ impl App { kind: event::KeyEventKind::Press, .. }) => { - // this is the function that deleted the connection from the main lists too + // this will evaluate to run the delete confirmation dialog from the core ui self.show_delete_confirmation = true; } From cb968c68b63d89e5ac08d1d96c57660f6ed57e26 Mon Sep 17 00:00:00 2001 From: santoshxshrestha Date: Tue, 30 Dec 2025 00:08:13 +0545 Subject: [PATCH 03/10] more info about installation --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 972fabd..e6815cf 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ A Terminal UI (TUI) for NetworkManager, built in Rust as a simple wrapper around > **Learning project:** This app was created mainly for learning Rust, exploring TUI design, and experimenting with how terminal applications work. It’s not meant to be super polished or perfect-just a fun side project! +> This Rust code spends so much time cloning and unlocking things, it’s almost as leisurely as a Python script trying to sort a spreadsheet column-with a side of JavaScript callbacks for maximum confusion. But with better learning and experience, future versions will absolutely get sharper and faster! + ## What’s this? It’s basically a text-based network manager for your Linux system (using NetworkManager), controlled from your terminal-like `nmtui`, but home-brewed. You can: @@ -23,6 +25,14 @@ You’ll need Rust (https://rustup.rs), then run: cargo build --release ``` +### Install (recommended) + +You can also install directly from crates.io using Cargo: + +``` +cargo install nmtui +``` + ### Run ``` @@ -38,6 +48,6 @@ cargo run ## License -MIT (see LICENSE) +MIT ([see LICENSE](./LICENSE)) --- From 0c38f21456f2f77d872262ab4a00402cf1b39728 Mon Sep 17 00:00:00 2001 From: santoshxshrestha Date: Tue, 30 Dec 2025 00:09:42 +0545 Subject: [PATCH 04/10] docs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e6815cf..a10b9e2 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ A Terminal UI (TUI) for NetworkManager, built in Rust as a simple wrapper around `nmcli`. -> **Learning project:** This app was created mainly for learning Rust, exploring TUI design, and experimenting with how terminal applications work. It’s not meant to be super polished or perfect-just a fun side project! +> This app was created mainly for learning Rust, exploring TUI design, and experimenting with how terminal applications work. It’s not meant to be super polished or perfect-just a fun side project! -> This Rust code spends so much time cloning and unlocking things, it’s almost as leisurely as a Python script trying to sort a spreadsheet column-with a side of JavaScript callbacks for maximum confusion. But with better learning and experience, future versions will absolutely get sharper and faster! +_This Rust code spends so much time cloning and unlocking things, it’s almost as leisurely as a Python script trying to sort a spreadsheet column-with a side of JavaScript callbacks for maximum confusion. But with better learning and experience, future versions will absolutely get sharper and faster!_ ## What’s this? From 6e9efcf62d268c34b541ee1391f06b9add2be1a0 Mon Sep 17 00:00:00 2001 From: santoshxshrestha Date: Tue, 30 Dec 2025 00:22:42 +0545 Subject: [PATCH 05/10] docs: added the proper changelog --- CHANGELOG.md | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 580df46..0669e13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,28 @@ All notable changes to this project will be documented in this file. ## [Unreleased] -- (future changes go here) -## [0.1.0] – Working State -- Initial project structure and working TUI -- Basic network scanning, connecting, and disconnecting via NetworkManager (`nmcli`) -- Just a learning project, not production-ready! +## [1.0.0] - 2025-12-30 + +### Added + +- documentation and comments +- help menu +- list for saved connections, +- delete connection confirmation popup, +- listners for all the popups/menus + +### Changed + +- code refactoring and cleanup +- force full modularization of codebase + +## [0.1.0] - 2025-12-21 (init date) + +### Added + +- Initial project structure +- Working state with some feat like network scanning + +[Unreleased]: https://github.com/santoshxshrestha/rmxt/compare/v0.1.0...HEAD +[0.1.0]: https://github.com/santoshxshrestha/rmxt/releases/tag/v0.1.0 From 48a9d9f9ba3e27a5e0b462368039b6b8e7b8d511 Mon Sep 17 00:00:00 2001 From: santoshxshrestha Date: Tue, 30 Dec 2025 00:24:29 +0545 Subject: [PATCH 06/10] bump version to v1.0.0 --- Cargo.lock | 14 +++++++------- Cargo.toml | 2 +- flake.lock | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a994c18..70bfc13 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -336,9 +336,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee5b5339afb4c41626dde77b7a611bd4f2c202b897852b4bcf5d03eddc61010" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "lazy_static" @@ -423,7 +423,7 @@ dependencies = [ [[package]] name = "nmtui" -version = "0.1.0" +version = "1.0.0" dependencies = [ "color-eyre", "crossterm 0.29.0", @@ -488,9 +488,9 @@ checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "proc-macro2" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +checksum = "9695f8df41bb4f3d222c95a67532365f569318332d03d5f3f67f37b20e6ebdf0" dependencies = [ "unicode-ident", ] @@ -583,9 +583,9 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62049b2877bf12821e8f9ad256ee38fdc31db7387ec2d3b3f403024de2034aea" +checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" [[package]] name = "scopeguard" diff --git a/Cargo.toml b/Cargo.toml index 63ede6a..f521e8e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nmtui" -version = "0.1.0" +version = "1.0.0" edition = "2024" authors = ["Santosh Shrestha "] description = "Wrapper around nmcli" diff --git a/flake.lock b/flake.lock index 56a8086..0cccec1 100644 --- a/flake.lock +++ b/flake.lock @@ -59,11 +59,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1766651565, - "narHash": "sha256-QEhk0eXgyIqTpJ/ehZKg9IKS7EtlWxF3N7DXy42zPfU=", + "lastModified": 1766902085, + "narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3e2499d5539c16d0d173ba53552a4ff8547f4539", + "rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4", "type": "github" }, "original": { From 1743a0e5cf372a21c8833a237af0acac84c61a67 Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Mon, 29 Dec 2025 18:44:15 +0000 Subject: [PATCH 07/10] =?UTF-8?q?=F0=9F=93=9D=20Add=20docstrings=20to=20`d?= =?UTF-8?q?ocs`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docstrings generation was requested by @santoshxshrestha. * https://github.com/santoshxshrestha/nmtui/pull/21#issuecomment-3697229494 The following files were modified: * `src/apps/core/saved_connection.rs` --- src/apps/core/saved_connection.rs | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/apps/core/saved_connection.rs b/src/apps/core/saved_connection.rs index 6bb48ac..32c589f 100644 --- a/src/apps/core/saved_connection.rs +++ b/src/apps/core/saved_connection.rs @@ -58,6 +58,30 @@ impl SavedConnections { } impl App { + /// Handle keyboard input when the saved-connections UI is active and update the application state. + /// + /// Recognizes key presses and performs the following actions: + /// - 'q' or Esc: close the saved-connections view + /// - Ctrl+C: exit the application + /// - 'd': show the delete-confirmation dialog + /// - 'j' or Down: advance the saved-connection selection by one + /// - 'k' or Up: move the saved-connection selection back by one + /// - 'h' or '?': show the help view + /// - Ctrl+R: refresh the saved connections list by re-fetching saved connections + /// + /// # Returns + /// + /// `Ok(())` on success, or an `io::Error` if polling or reading terminal input fails. + /// + /// # Examples + /// + /// ``` + /// # use std::io; + /// # // `App` must be constructed according to the surrounding codebase. + /// # let mut app = App::default(); + /// // Process any pending saved-list input once. + /// let _ = app.handle_saved(); + /// ``` pub fn handle_saved(&mut self) -> io::Result<()> { if poll(Duration::from_micros(1))? { match event::read()? { @@ -164,4 +188,4 @@ impl App { pub fn close_saved_list(&mut self) { self.show_saved = false; } -} +} \ No newline at end of file From 7d67cd1738ddea77af1744100a0b9be2daf9cfa6 Mon Sep 17 00:00:00 2001 From: Santosh Shrestha Date: Tue, 30 Dec 2025 00:31:12 +0545 Subject: [PATCH 08/10] Update CHANGELOG.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0669e13..8045bc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ All notable changes to this project will be documented in this file. - help menu - list for saved connections, - delete connection confirmation popup, -- listners for all the popups/menus +- listeners for all the popups/menus ### Changed From db327cd53b0e7169cc291b62bdbb446182d4fa67 Mon Sep 17 00:00:00 2001 From: santoshxshrestha Date: Tue, 30 Dec 2025 00:33:45 +0545 Subject: [PATCH 09/10] lint i guess --- src/apps/core/saved_connection.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/core/saved_connection.rs b/src/apps/core/saved_connection.rs index 32c589f..5c1b098 100644 --- a/src/apps/core/saved_connection.rs +++ b/src/apps/core/saved_connection.rs @@ -188,4 +188,4 @@ impl App { pub fn close_saved_list(&mut self) { self.show_saved = false; } -} \ No newline at end of file +} From 33b1c82f1044f6528287fdf1aafb64a5ed15b459 Mon Sep 17 00:00:00 2001 From: santoshxshrestha Date: Tue, 30 Dec 2025 00:35:58 +0545 Subject: [PATCH 10/10] docs: added the links to the releases --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8045bc5..9108367 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,5 +26,6 @@ All notable changes to this project will be documented in this file. - Initial project structure - Working state with some feat like network scanning -[Unreleased]: https://github.com/santoshxshrestha/rmxt/compare/v0.1.0...HEAD -[0.1.0]: https://github.com/santoshxshrestha/rmxt/releases/tag/v0.1.0 +[Unreleased]: https://github.com/santoshxshrestha/nmtui/compare/v1.0.0...HEAD +[1.0.0]: https://github.com/santoshxshrestha/nmtui/releases/tag/v1.0.0 +[0.1.0]: https://github.com/santoshxshrestha/nmtui/releases/tag/v0.1.0