Skip to content
Merged

Docs #21

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Changelog

All notable changes to this project will be documented in this file.

## [Unreleased]

## [1.0.0] - 2025-12-30

### Added

- documentation and comments
- help menu
- list for saved connections,
- delete connection confirmation popup,
- listeners 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/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
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nmtui"
version = "0.1.0"
version = "1.0.0"
edition = "2024"
authors = ["Santosh Shrestha <santoshxshrestha@gmail.com>"]
description = "Wrapper around nmcli"
Expand Down
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,53 @@
wrapper around cli
# nmtui

A Terminal UI (TUI) for NetworkManager, built in Rust as a simple wrapper around `nmcli`.

> 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:

- 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
```

### Install (recommended)

You can also install directly from crates.io using Cargo:

```
cargo install nmtui
```

### 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](./LICENSE))

---
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 33 additions & 1 deletion src/apps/core/saved_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()? {
Expand Down Expand Up @@ -88,7 +112,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;
}

Expand Down Expand Up @@ -134,6 +158,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();
}
_ => {}
};
}
Expand Down
Loading