Skip to content

Commit 2923a9b

Browse files
Auto-create keybind config and add GPL license metadata
1 parent 38e04e7 commit 2923a9b

7 files changed

Lines changed: 273 additions & 5 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nettui"
3-
version = "0.1.6"
3+
version = "0.1.7"
44
edition = "2024"
55
description = "Unified TUI for Wi-Fi and Ethernet"
66
license = "GPL-3.0-only"

LICENSE

Lines changed: 232 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
It is built as a clean-room project inspired by the UX direction of tools like `impala` and `ethtui`,
66
but with one app shell and switchable Wi-Fi/Ethernet panels.
7+
This project was inspired by and builds upon ideas from Impala by pythops.
78

89
## Scope (v0.1)
910

@@ -78,7 +79,9 @@ Ethernet tab:
7879

7980
`~/.config/nettui/keybinds.toml`
8081

81-
Use the example template:
82+
On first launch, `nettui` automatically creates this file with defaults if it does not exist.
83+
84+
You can still reset it manually from template:
8285

8386
```bash
8487
mkdir -p ~/.config/nettui
@@ -100,6 +103,10 @@ cargo build
100103
cargo test
101104
```
102105

106+
## License
107+
108+
`nettui` is licensed under `GPL-3.0-only`. See `LICENSE`.
109+
103110
## Omarchy integration (optional)
104111

105112
Recommended launch command for Omarchy-style app-id handling:

src/app.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (C) 2026 skibidiandulka
2+
// Clean-room implementation inspired by Impala UX by pythops.
3+
14
use crate::{
25
backend::{iwd::IwdBackend, networkd::NetworkdBackend, traits::EthernetBackend},
36
domain::{

src/keybinds.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (C) 2026 skibidiandulka
2+
// Clean-room implementation inspired by Impala UX by pythops.
3+
14
use serde::Deserialize;
25
use std::{env, fs, path::PathBuf};
36

@@ -45,6 +48,8 @@ impl Keybinds {
4548
return out;
4649
};
4750

51+
ensure_default_config_exists(&path);
52+
4853
let Ok(raw) = fs::read_to_string(path) else {
4954
return out;
5055
};
@@ -100,6 +105,24 @@ fn keybinds_path() -> Option<PathBuf> {
100105
Some(PathBuf::from(home).join(".config/nettui/keybinds.toml"))
101106
}
102107

108+
fn ensure_default_config_exists(path: &PathBuf) {
109+
if path.exists() {
110+
return;
111+
}
112+
let Some(parent) = path.parent() else {
113+
return;
114+
};
115+
if fs::create_dir_all(parent).is_err() {
116+
return;
117+
}
118+
119+
let _ = fs::write(path, default_config_template());
120+
}
121+
122+
fn default_config_template() -> &'static str {
123+
include_str!("../config/keybinds.toml.example")
124+
}
125+
103126
fn apply_override(target: &mut char, value: Option<String>) {
104127
let Some(raw) = value else {
105128
return;

src/ui/wifi.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (C) 2026 skibidiandulka
2+
// Clean-room implementation inspired by Impala UX by pythops.
3+
14
use crate::{app::App, domain::common::WifiFocus, domain::wifi::WifiDeviceInfo};
25
use ratatui::{
36
Frame,
@@ -321,9 +324,9 @@ fn render_wifi_passphrase_popup(app: &App, frame: &mut Frame) {
321324
);
322325

323326
let field_block = Block::default()
324-
.borders(Borders::ALL)
327+
.borders(Borders::BOTTOM)
325328
.border_style(Style::default().fg(Color::Cyan))
326-
.border_type(BorderType::Rounded);
329+
.border_type(BorderType::Plain);
327330
let field_inner = field_block.inner(chunks[2]);
328331
frame.render_widget(field_block, chunks[2]);
329332
frame.render_widget(

0 commit comments

Comments
 (0)