griccardos / rusl

Rust GUI interface for ripgrep / file searcher / content searcher
MIT License
16 stars 3 forks source link

rusl

Rust GUI interface for ripgrep / file searcher / content searcher

rusl aims to be a slim frontend for file and content search with the heavy lifting done by ripgrep and other libraries. This project started out to evaluate the maturity of some GUI frameworks in rust. See further down for comments on the GUIs.

Each GUI Can be found in its own folder. To compile, cd into the folder, and cargo build.

Druid is currently the most feature complete and releases are Druid.

To enable pdf/word/excel searching, tick the extended box in settings. Currently this reads entire document to memory, so may not be suitable for large documents. Has a big impact on search time, so disabled by default.

Why the name rusl? Well, it's the sound made when you are searching through leaves or papers for something. Also it's 75% of the letters in rust!

image

Objectives

This project relies heavily on ripgrep and BurntSushi's libraries.

Shout out to BurntSushi for the awesome work (https://github.com/BurntSushi)

How to build

Linux/Druid requires gtk+3; see GTK installation page . (On ubuntu-based distro, run sudo apt-get install libgtk-3-dev )

Contributions

Contributions are welcome. You are also welcome to add a new GUI frontend in a new branch.

GUI Libraries

Each library is on a different branch. Change branch to select different UI.

Summary

Druid Slint EGUI ICED Dioxus
Dependencies 171 439 243 312 337
Build time cold (s) 18 40 16 42 56
Lines 403 479 229 198 236
File size windows (kb) 4739 6926 7071 10276 7026

UI

Druid Slint EGUI ICED Dioxus
- Toolbar icon
- Window icon
- Tab between fields ✓(manual impl)
- paste into textbox

Functionality Implemented

Druid Slint EGUI ICED Dioxus
- Filename search
- Content search
- Match Highlighting
- Settings
- Copy to clipboard
- Windows
- Linux
- Mac ✓*1

Slint

This project started off using Slint (https://slint-ui.com/). It was really easy to get up and running and within 2 days had something relatively complete (with a few concessions made). There were so many good things about the way it worked, and the easy of setting it up. Easy concepts such as events, callbacks, and communication between GUI and backend, made it very simple and straightforward to use.

Unfortunately when I tried compiling for Linux, I realised that some of the functionality did not work on Linux. Will keep an eye on this one.

Pros

Cons

Dioxus

(https://dioxuslabs.com/)

Having never used react or something similar, I struggled a bit with hooks. However after a bit of time, and as the documentation became better, was able to get a solution working. Needed to use async and use_coroutine to run in the background and check for results. Other than that it was easy to set up user interface if you are familiar with front end web development.

Pros

Cons

Druid

(https://github.com/linebender/druid) Next up was Druid. I have used it in a personal project previously, and feel like it has a lot of potential. First off, it is a little more complicated than Slint, and there are additional things to learn like Data, Lens etc. There is some boilerplate to set up a custom widget.

However it feels like one can do almost everything they need, and if there is no existing widget, it gives us the tools to build our own widgets. I really like the feel of this. My favourite in terms of professional look and feel.

Pros

Cons

EGUI

(https://github.com/emilk/egui) This one is a real gem, so easy to use and setup. It is an immediate mode GUI, which means it gets repainted many times per second. It only took a few hours and had most of the functionality. A lot less fighting with the borrow checker here, and still had mut references to self for all the modification and lookup to the app state that was required. My favourite in terms of getting something up and running fast with almost all functionality.

Pros

ICED

(https://github.com/iced-rs/iced) Nice library using Elm framework. Easy to get up and running. Uses winit for window, so one can set the icon for window itself in Windows

Pros