I made an ugly wireguard client GUI in slint for NixOS

https://radicle.network/nodes/iris.radicle.network/rad:z2mMYTQ3TTMFbVnRDA9UMbVhMGo6L

It's not exclusive to NixOS, but I've only packaged it for NixOS.

The UI looks like shit, but it allows showing all the configs in /etc/wireguard and toggling them on or off with wg-quick.

The biggest issue I had was with slint. I can't make sense of it (yet).

This was written because after getting a windscribe subscription, I found out that the app doesn't work on #NixOS and the pull request to add it 1) doesn't work, 2) is being nitpicked to death.

17 points · 14 comments · view on lemmy.world

14 Comments

CameronDev@programming.dev · 8 pts · 4d (7 replies)

You cant tell us the UI is ugly and not share screenshots of the gore!

vald@mbin.linuxnation.social · 8 pts · 4d (6 replies)

:D I had edited the post and added a picture. I guess that's not federating well. Attached it to this comment. Hopefully it shows up.

Screenshot of the Wireguard UI with a list of configuration and a preview of the config

CameronDev@programming.dev · 4 pts · 4d (5 replies)

That isnt that bad, I've definitely seen worse UIs. Out of curiosity, why did you pick Slint?

vald@mbin.linuxnation.social · 5 pts · 4d (4 replies)

I didn't want any browser + Rust solution (bloated) --> no Tauri, no electron, no webkit, no QML (that's also webkit, isn't it?)

Didn't want immediate mode - just not convinced by it --> no egui and all that other stuff

Wanted to click together a UI and not fight too much with C++ bindings --> GTK4 got rid of their WYSIWYG editor, Qt creator doesn't do Rust AFAIK, and all Qt bindings seemed like a lot of work getting it to run

Slint just seemed like the best thing I could get running under an hour, given those conditions.

If you can think of something else that fits better given those criteria, I'd be happy to check it out.

CameronDev@programming.dev · 1 pts · 4d (3 replies)

No suggestions, just curious about your rationale. I've used dioxus and egui a bit. Both have some fairly rough edges.

vald@mbin.linuxnation.social · 2 pts · 4d (2 replies)

I might have to rethink my stance on no browsers, because Dioxus looks very easy compared to slint. And it supports mobile, which might come in handy for other projects have I have in mind.

You do say dioxus has fairly rough edges. Could you elaborate further? I was considering trying it out.

CameronDev@programming.dev · 2 pts · 4d (1 reply)

Are you familiar with react? Its basically react, but rust.

The rsx! macro is very clever, but it doesn't format with cargo fmt, you have to use dx fmt separately. Your mileage may vary as to whether your LSP or IDE understands it.

Hot reload was a bit more like a plain reload. Still incredibly useful, but most of the time it did a rebuild and restart.

I was trying to make a button that repeatedly fired as long as the mouse was held down, but for some reason the mouse up event would get lost, and then the button was stuck on.

The "native" desktop is basically a custom browser with the JS engine replaced with rust. Its not as heavy as a full browser, but its not light either. Haven't tried the mobile versions, I suspect they are similar.

If you know react, its not a bad way to transfer those skills. Worth a try IMO, I am still using it for my project, although I may rewrite and switch to egui if I can't solve my repeating button issue.

vald@mbin.linuxnation.social · 2 pts · 2d

Thank you for the response. I don't know React, but I do know Vue and Angular. I've heard React is a bigger beast than both put together. That kind of holds me back.

If slint pisses me off enough, I'll give Dioxus a shot. It's next on my list. Good luck with your app. Hopefully the button issue can be resolved.

vald@mbin.linuxnation.social · 3 pts · 4d

Future goals for when I have time again (from easy to hard) :

  • filter configs by connection status
  • sort configs by name or connection status
  • kill-switch (supposedly easy to add via Post-Up, Post-Down?)
  • download VPN configs from other providers: windscribe, proton, airvpn, ivpn, etc.
BCsven@lemmy.ca · 1 pts · 4d (4 replies)

Serious question: is it easier to build your own than expand on what's already developed?

vald@mbin.linuxnation.social · 2 pts · 4d (3 replies)

No idea what that is. I'm on KDE if that means anything.

The goal was to be able to easily use all wireguard configs downloaded from windscribe --> no "just open a command line and run sudo wg-quick up ...". I don't want to enter the root password every time. Other VPN clients don't require that.

Does your thing achieve it somehow? I wouldn't mind looking at it if that's the case.

BCsven@lemmy.ca · 1 pts · 4d (2 replies)

It's built into GNOME network manager I believe. I'm not a programmer, so you'd have to dig into what package supports that GUI. But somebody has written that GUI to add Wireguard in the VPN section.

vald@mbin.linuxnation.social · 5 pts · 4d (1 reply)

Yeah, that's not what I'm looking for. Windscribe has 200+ VPN locations. I'd have to manually import every single one. Sure, probably would take less time than it took writing this, but if they update a few configs (or everything at once for some reason), I'd have to go through the hassle of removing the existing configs and updating each one manually again.

If it had a batch importer or even just supported configs in /etc/wireguard (or a custom directory), that would also be great. But from what I understand, it's a frontend for NetworkManager, which uses a different configuration format for connections .nmconnection and is terribly documented.

BCsven@lemmy.ca · 3 pts · 4d

Ah, I see.