Skip to content
Merged
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
50 changes: 45 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ on:
workflow_dispatch:
branches: [ master ]
inputs:
crate:
description: 'Crate to release'
required: true
type: choice
options:
- nmrs
- nmrs-gui
version:
description: 'Version to release'
required: true
Expand Down Expand Up @@ -39,6 +46,7 @@ jobs:
python3 scripts/bump_version.py "${{ github.event.inputs.version }}" "${{ github.event.inputs.release_type }}" || echo "⚠ Version bump completed with warnings"
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
echo "RELEASE_TYPE=${{ github.event.inputs.release_type }}" >> $GITHUB_ENV
echo "CRATE=${{ github.event.inputs.crate }}" >> $GITHUB_ENV

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
Expand Down Expand Up @@ -84,12 +92,44 @@ jobs:
fi

git add -A
git commit -m "chore: bump version to ${{ env.VERSION }}-${{ env.RELEASE_TYPE }}"
git tag -a "v${{ env.VERSION }}-${{ env.RELEASE_TYPE }}" -m "Release v${{ env.VERSION }}-${{ env.RELEASE_TYPE }}"

# Create crate-specific tag
CRATE="${{ env.CRATE }}"
VERSION="${{ env.VERSION }}"
RELEASE_TYPE="${{ env.RELEASE_TYPE }}"

if [ "$CRATE" = "nmrs" ]; then
TAG_PREFIX="nmrs-"
COMMIT_MSG="chore(nmrs): bump version to ${VERSION}"
if [ "$RELEASE_TYPE" = "beta" ]; then
TAG_NAME="${TAG_PREFIX}v${VERSION}-beta"
COMMIT_MSG="${COMMIT_MSG}-beta"
else
TAG_NAME="${TAG_PREFIX}v${VERSION}"
fi
elif [ "$CRATE" = "nmrs-gui" ]; then
TAG_PREFIX="gui-"
COMMIT_MSG="chore(nmrs-gui): bump version to ${VERSION}"
if [ "$RELEASE_TYPE" = "beta" ]; then
TAG_NAME="${TAG_PREFIX}v${VERSION}-beta"
COMMIT_MSG="${COMMIT_MSG}-beta"
else
TAG_NAME="${TAG_PREFIX}v${VERSION}"
fi
else
echo "Error: Unknown crate $CRATE"
exit 1
fi

echo "Creating tag: $TAG_NAME"
git commit -m "$COMMIT_MSG"
git tag -a "$TAG_NAME" -m "Release $TAG_NAME"

# Force push to handle any race conditions (safe since we just reset)
git push origin "$BRANCH" --force-with-lease
git push origin "v${{ env.VERSION }}-${{ env.RELEASE_TYPE }}"
git push origin "$TAG_NAME"

echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV

- name: Extract release notes
run: |
Expand All @@ -98,8 +138,8 @@ jobs:
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.VERSION }}-${{ env.RELEASE_TYPE }}
name: Release v${{ env.VERSION }}-${{ env.RELEASE_TYPE }}
tag_name: ${{ env.TAG_NAME }}
name: Release ${{ env.TAG_NAME }}
body_path: RELEASE_NOTES.md
draft: false
prerelease: ${{ env.RELEASE_TYPE == 'beta' }}
Expand Down
18 changes: 5 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog
## [Unreleased]
- Core: Full WireGuard VPN support ([#92](https://github.com/cachebag/nmrs/issues/92))

## [0.5.0-beta] - 2025-12-15
### Changed
Expand Down Expand Up @@ -118,19 +119,10 @@
- EAP connections default to no certificates (advanced certificate management coming in future releases)
- VPN connections planned for near future

[0.3.0-beta]: https://github.com/cachebag/nmrs/compare/v0.2.0-beta
[0...v0.3.0-beta
[0.4.0-beta]: https://github.com/cachebag/nmrs/compare/v0.3.0-beta
[0.4.0-beta]: https://github.com/cachebag/nmrs/compare/v0.3.0-beta
[0...v0.4.0-beta
[0.5.0-beta]: https://github.com/cachebag/nmrs/compare/v0.3.0-beta
[0...v0.5.0-beta
[unreleased]: https://github...v0.4.0-beta
[0.4.0-beta]: https://github.com/cachebag/nmrs/compare/v0.3.0-beta
[0...v0.4.0-beta
[0.5.0-beta]: https://github.com/cachebag/nmrs/compare/v0.3.0-beta
[0...v0.5.0-beta
[unreleased]: https://github.com/cachebag/nmrs/compare/v0.5.0-beta...HEAD
[Unreleased]: https://github.com/cachebag/nmrs/compare/v0.5.0-beta...HEAD
[0.5.0-beta]: https://github.com/cachebag/nmrs/compare/v0.4.0-beta...v0.5.0-beta
[0.4.0-beta]: https://github.com/cachebag/nmrs/compare/v0.3.0-beta...v0.4.0-beta
[0.3.0-beta]: https://github.com/cachebag/nmrs/compare/v0.2.0-beta...v0.3.0-beta
[0.2.0-beta]: https://github.com/cachebag/nmrs/compare/v0.1.1-beta...v0.2.0-beta
[0.1.1-beta]: https://github.com/cachebag/nmrs/compare/v0.1.0-beta...v0.1.1-beta
[0.1.0-beta]: https://github.com/cachebag/nmrs/releases/tag/v0.1.0-beta
9 changes: 8 additions & 1 deletion Cargo.lock

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

21 changes: 20 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,23 @@ members = [
"nmrs-gui"
]

resolver = "3"
resolver = "2"

[workspace.package]
edition = "2021"
license = "MIT"
repository = "https://github.com/cachebag/nmrs"

[workspace.dependencies]
# Core dependencies
zbus = "5.12.0"
zvariant = "5.8.0"
log = "0.4.29"
serde = { version = "1.0.228", features = ["derive"] }
thiserror = "2.0.17"
uuid = { version = "1.19.0", features = ["v4", "v5"] }
futures = "0.3.31"
futures-timer = "3.0.3"

# Dev dependencies
tokio = { version = "1.48.0", features = ["rt-multi-thread", "macros", "sync", "time"] }
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ async fn main() -> nmrs::Result<()> {
Ok(())
}
```
# <p align="center"> GUI Application </p>
# <p align="center"> nmrs-gui </p>

![Version](https://img.shields.io/badge/nmrs--gui-0.5.0--beta-orange?style=flat-square)

This repository also includes `nmrs-gui`, a Wayland-compatible NetworkManager frontend built with GTK4.

Expand Down Expand Up @@ -148,7 +150,7 @@ Edit `~/.config/nmrs/style.css` to customize the interface. There are also pre-d
- [x] Generic
- [x] Wireless
- [ ] Any
- [ ] Wired
- [X] Wired
- [ ] ADSL
- [ ] Bluetooth
- [ ] Bond
Expand Down Expand Up @@ -177,7 +179,7 @@ Edit `~/.config/nmrs/style.css` to customize the interface. There are also pre-d
- [ ] VXLAN
- [ ] Wi-Fi P2P
- [ ] WiMAX
- [ ] WireGuard
- [X] WireGuard
- [ ] WPAN

### Configurations
Expand Down Expand Up @@ -211,6 +213,12 @@ Edit `~/.config/nmrs/style.css` to customize the interface. There are also pre-d

Contributions are welcome. Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.

## Requirements

- **Rust**: 1.78.0 or later (for `nmrs` library)
- **Rust**: 1.85.1 or later (for `nmrs-gui` with GTK4)
- **NetworkManager**: Running and accessible via D-Bus
- **Linux**: This library is Linux-specific

## License

Expand Down
2 changes: 1 addition & 1 deletion nmrs-aur
Submodule nmrs-aur updated from 1e81b6 to 4ee42d
15 changes: 11 additions & 4 deletions nmrs-gui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
[package]
name = "nmrs-gui"
version = "0.5.0"
edition = "2024"
authors = ["Akrm Al-Hakimi <alhakimiakrmj@gmail.com>"]
edition.workspace = true
rust-version = "1.85.1"
description = "GTK4 GUI for managing NetworkManager connections"
license.workspace = true
repository.workspace = true
keywords = ["networkmanager", "gui", "gtk", "linux"]
categories = ["gui"]

[dependencies]
log = "0.4.29"
nmrs = { path = "../nmrs" }
tokio = { version = "1.48.0", features = ["full"] }
nmrs = { path = "../nmrs", version = "1.0.0" }
gtk = { version = "0.10.3", package = "gtk4" }
glib = "0.21.5"
tokio = { version = "1.48.0", features = ["full"] }
log = "0.4.29"
dirs = "6.0.0"
fs2 = "0.4.3"
anyhow = "1.0.100"
Expand Down
2 changes: 1 addition & 1 deletion nmrs-gui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ pub mod theme_config;
pub mod ui;

use clap::{ArgAction, Parser};
use gtk::Application;
use gtk::prelude::*;
use gtk::Application;

use crate::file_lock::acquire_app_lock;
use crate::style::load_css;
Expand Down
33 changes: 17 additions & 16 deletions nmrs-gui/src/ui/connect.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use glib::Propagation;
use gtk::{
ApplicationWindow, Box as GtkBox, Button, CheckButton, Dialog, Entry, EventControllerKey,
FileChooserAction, FileChooserDialog, Label, Orientation, ResponseType, prelude::*,
prelude::*, ApplicationWindow, Box as GtkBox, Button, CheckButton, Dialog, Entry,
EventControllerKey, FileChooserAction, FileChooserDialog, Label, Orientation, ResponseType,
};
use log::{debug, error};
use nmrs::{
NetworkManager,
models::{EapMethod, EapOptions, Phase2, WifiSecurity},
NetworkManager,
};
use std::rc::Rc;

Expand All @@ -21,11 +21,11 @@ pub fn connect_modal(
let parent_weak = parent.downgrade();

glib::MainContext::default().spawn_local(async move {
if let Some(current) = nm.current_ssid().await
&& current == ssid_owned
{
debug!("Already connected to {current}, skipping modal");
return;
if let Some(current) = nm.current_ssid().await {
if current == ssid_owned {
debug!("Already connected to {current}, skipping modal");
return;
}
}

if let Some(parent) = parent_weak.upgrade() {
Expand Down Expand Up @@ -127,14 +127,15 @@ fn draw_connect_modal(

let cert_entry = cert_entry_for_browse.clone();
file_dialog.connect_response(move |dialog, response| {
if response == ResponseType::Accept
&& let Some(file) = dialog.file()
&& let Some(path) = file.path()
{
cert_entry
.as_ref()
.unwrap()
.set_text(&path.to_string_lossy());
if response == ResponseType::Accept {
if let Some(file) = dialog.file() {
if let Some(path) = file.path() {
cert_entry
.as_ref()
.unwrap()
.set_text(&path.to_string_lossy());
}
}
}
dialog.close();
});
Expand Down
12 changes: 6 additions & 6 deletions nmrs-gui/src/ui/header.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use glib::clone;
use gtk::STYLE_PROVIDER_PRIORITY_USER;
use gtk::prelude::*;
use gtk::{Align, Box as GtkBox, HeaderBar, Label, ListBox, Orientation, Switch, glib};
use gtk::STYLE_PROVIDER_PRIORITY_USER;
use gtk::{glib, Align, Box as GtkBox, HeaderBar, Label, ListBox, Orientation, Switch};
use std::cell::Cell;
use std::collections::HashSet;
use std::rc::Rc;
Expand Down Expand Up @@ -65,10 +65,10 @@ pub fn build_header(
let names: Vec<&str> = THEMES.iter().map(|t| t.name).collect();
let dropdown = gtk::DropDown::from_strings(&names);

if let Some(saved) = crate::theme_config::load_theme()
&& let Some(idx) = THEMES.iter().position(|t| t.key == saved.as_str())
{
dropdown.set_selected(idx as u32);
if let Some(saved) = crate::theme_config::load_theme() {
if let Some(idx) = THEMES.iter().position(|t| t.key == saved.as_str()) {
dropdown.set_selected(idx as u32);
}
}

dropdown.set_valign(gtk::Align::Center);
Expand Down
28 changes: 14 additions & 14 deletions nmrs-gui/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ pub mod wired_page;

use gtk::prelude::*;
use gtk::{
Application, ApplicationWindow, Box as GtkBox, Label, Orientation,
STYLE_PROVIDER_PRIORITY_USER, ScrolledWindow, Spinner, Stack,
Application, ApplicationWindow, Box as GtkBox, Label, Orientation, ScrolledWindow, Spinner,
Stack, STYLE_PROVIDER_PRIORITY_USER,
};
use std::cell::Cell;
use std::rc::Rc;
Expand All @@ -32,20 +32,20 @@ pub fn build_ui(app: &Application) {
win.set_title(Some(""));
win.set_default_size(100, 600);

if let Some(key) = crate::theme_config::load_theme()
&& let Some(theme) = THEMES.iter().find(|t| t.key == key.as_str())
{
let provider = gtk::CssProvider::new();
provider.load_from_data(theme.css);
if let Some(key) = crate::theme_config::load_theme() {
if let Some(theme) = THEMES.iter().find(|t| t.key == key.as_str()) {
let provider = gtk::CssProvider::new();
provider.load_from_data(theme.css);

let display = gtk::prelude::RootExt::display(&win);
gtk::style_context_add_provider_for_display(
&display,
&provider,
STYLE_PROVIDER_PRIORITY_USER,
);
let display = gtk::prelude::RootExt::display(&win);
gtk::style_context_add_provider_for_display(
&display,
&provider,
STYLE_PROVIDER_PRIORITY_USER,
);

win.add_css_class("dark-theme");
win.add_css_class("dark-theme");
}
}

let vbox = GtkBox::new(Orientation::Vertical, 0);
Expand Down
Loading
Loading