1
0
Fork 0
mirror of synced 2024-05-06 05:22:25 +12:00
czkawka/README.md

163 lines
6.7 KiB
Markdown
Raw Normal View History

2020-08-27 06:49:43 +12:00
# Czkawka
Czkawka is a simple, fast and easy to use alternative to FSlint, written in Rust.
This is my first ever project in Rust so many things might not be written in the most optimal way.
2020-09-27 19:32:44 +13:00
2020-10-02 08:29:40 +13:00
![Czkawka](https://user-images.githubusercontent.com/41945903/94850792-c200cc80-0427-11eb-99a7-23ab9cf39556.gif)
2020-09-30 21:06:40 +13:00
## Why?
There's a lot of tools for finding duplicates, empty folders, temporary files etc. on the Internet, but in most cases these are only available as CLI, which is hard to use by users.
2020-10-02 03:54:26 +13:00
GUI FSlint allows selecting different files and folders easily, but is based on old and unsupported Python 2 and GTK 2.
2020-10-02 03:54:26 +13:00
Other tools are usually written in C/C++ for high performance but still need to be tested a lot for memory leaks, invalid memory reads/writes and double frees.
2020-09-30 21:06:40 +13:00
2020-10-02 03:54:26 +13:00
But the most important thing for me was to learn Rust and create a program useful for the open source community.
2020-09-27 19:32:44 +13:00
## Features
- Written in fast and memory safe Rust
- CLI frontend, very fast and powerful with rich help
- GUI GTK frontend - uses modern GTK 3 and looks similar to FSlint
2020-10-02 08:29:40 +13:00
- Light/Dark theme match the appearance of the system
2020-09-27 19:32:44 +13:00
- GUI Orbtk frontend(Very early WIP) - alternative GUI with reduced functionality
- Saving results to a file - allows reading entries found by the tool easily
- Rich search option - allows setting absolute included and excluded directories, set of allowed file extensions or excluded items with * wildcard
- Clean Glade file in which UI can be easily modernized
2020-09-27 19:32:44 +13:00
- Multiple tools to use:
- Duplicates - Finds duplicates basing on size(fast), hash(accurate), first 1MB of hash(moderate)
- Empty Folders - Finds empty folders with the help of advanced algorithm
2020-09-27 19:32:44 +13:00
- Big Files - Finds provided number of the biggest files in given location
- Empty Files - Looks for empty files across disk
2020-09-30 21:06:40 +13:00
- Temporary Files - Allows finding temporary files
2020-10-17 23:56:05 +13:00
- Similar Files - Finds files which are not exactly the same
2020-08-27 06:49:43 +12:00
## Usage and requirements
2020-10-06 09:30:44 +13:00
### Requirements
For normal use of the program, the only requirement is having GTK 3.22+.
For CLI, Orbtk on all OS and GTK GUI on Windows, there are no special requirements.
2020-10-02 20:21:27 +13:00
Precompiled binaries are available here - https://github.com/qarmin/czkawka/releases/
2020-10-02 20:21:27 +13:00
You can also download the application with different commits here - https://github.com/qarmin/czkawka/actions
2020-10-06 09:30:44 +13:00
If the app does not run when clicking at a launcher, run it through a terminal.
2020-10-06 09:30:44 +13:00
### Cargo
You can install Czkawka easily from Cargo by typing `cargo install czkawka_gui`
2020-10-06 09:30:44 +13:00
### Snap, Flatpak, Appimage
Still WIP, but looking for help
### AUR - Arch Linux Package
Czkawka is also available in Arch Linux's AUR from which it can be easily downloaded and installed on the system.
```
yay -Syu czkawka-git
```
2020-10-06 09:30:44 +13:00
2020-10-02 20:21:27 +13:00
## Compilation
### Requirements
Rust 1.46 - probably lower also works fine(1.40 is needed by GTK)
2020-10-02 08:29:40 +13:00
GTK 3.22 - for GTK backend
2020-09-27 19:32:44 +13:00
For now only Linux (and maybe also macOS) is supported
- Install requirements for GTK
```
apt install -y libgtk-3-dev
```
2020-10-06 09:30:44 +13:00
### Compilation from source
- Download the source
```
2020-09-02 08:48:20 +12:00
git clone https://github.com/qarmin/czkawka.git
cd czkawka
```
2020-10-02 08:29:40 +13:00
- Run GTK GUI
```
cargo run --bin czkawka_gui
```
For Linux-to-Windows cross-building instruction look at the CI.
2020-10-02 08:29:40 +13:00
![GUI GTK](https://user-images.githubusercontent.com/41945903/94850801-c5945380-0427-11eb-8d4c-af4946ab02d5.png)
- Run alternative Orbtk GUI (Still WIP, currently stopped due https://github.com/intellij-rust/intellij-rust/issues/5943)
2020-10-06 09:30:44 +13:00
2020-09-06 06:26:10 +12:00
```
cargo run --bin czkawka_gui_orbtk
```
2020-09-08 04:14:02 +12:00
![GUI Orbtk](https://user-images.githubusercontent.com/41945903/92405241-7b27fb80-f135-11ea-9fc4-5ebc2b76b011.png)
2020-09-27 19:32:44 +13:00
- Run CLI(this will print help with a lot of examples)
2020-09-02 08:48:20 +12:00
```
cargo run --bin czkawka_cli
```
2020-09-21 04:53:53 +12:00
![CLI](https://user-images.githubusercontent.com/41945903/93716816-0bbcfd80-fb72-11ea-8d31-4c87cc2abe6d.png)
## Speed
Since Czkawka is written in Rust and aims to be a faster alternative to FSlint (written in Python), we need to compare the speed of these two tools.
I prepared a directory and performed a test without any folder exceptions(I removed all directories from FSlint and Czkawka from other tabs than Include Directory) which contained 176 056 files and 22194 folders and 88436 duplicated files in 52330 groups worth 6,2 GB.
The first run reads every file entry and saves it to cache, so this step is limited mostly by disk performance. In the second run the cache helps it, so searching is sometimes faster (with few duplicates even 10x faster).
2020-10-02 08:29:40 +13:00
Duplicate Checker(Version 0.1.4)
| App| Executing Time |
|:----------:|:-------------:|
| FSlint (First Run)| 284s |
| FSlint (Second Run)| 247s |
2020-10-02 08:29:40 +13:00
| Czkawka GUI Release(First Run) | 118s |
| Czkawka GUI Release(Second Run) | 120s |
I used Mprof for FSlint and Heaptrack for Czkawka
2020-10-02 08:29:40 +13:00
| App| Idle Ram | Max Operational Ram Usage | Stabilized after search usage |
|:----------:|:-------------:|:-------------:|:-------------:|
| FSlint | 55 MB | 160 MB | 150 MB |
2020-10-02 08:29:40 +13:00
| Czkawka GTK GUI Release | 8 MB | 76 MB | 75 MB |
Differences should be more visible when using slower CPU or faster disk.
2020-10-02 03:54:26 +13:00
## Comparsion with FSLint
| | Czkawka | FSlint |
|:----------:|:-------------:|:-----:|
| Language | Rust| Python |
2020-10-02 08:29:40 +13:00
| Framework | GTK 3 (Gtk-rs)| GTK 2 (PyGTK) |
| Ram Usage | Low | Medium |
| Duplicate finder | X | X |
| Empty files | X | X |
| Empty folders | X | X |
| Temporary files | X | X |
| Big files | X | |
| Similar images | X | |
2020-10-02 08:29:40 +13:00
| Installed packages | | X |
| Invalid names | | X |
| Names conflict | | X |
| Invalid symlinks | | X |
| Bad ID | | X |
| Non stripped binaries | | X |
| Redundant whitespace | | X |
2020-10-02 03:54:26 +13:00
| Project Activity | High | Very Low |
2020-10-02 19:58:02 +13:00
## Contributions
Contributions to this repository are welcome.
You can help by creating:
- Bug report - memory leaks, unexpected behavior, crashes
- Feature proposals - proposal to change/add/delete some features
- Pull Requests - implementing a new feature yourself or fixing bugs, but you have to pay attention to code quality. If the change is bigger, then it's a good idea to open a new issue to discuss changes.
2020-10-02 19:58:02 +13:00
The code should be clean and well formatted (Clippy and fmt are required in each PR).
2020-10-02 19:58:02 +13:00
The code should also be easy to read, so please use the simplest language possible without any magic numbers and variables with strange names. You should also try to write unit tests if possible.
2020-10-02 19:58:02 +13:00
2020-09-30 21:06:40 +13:00
## Name
Czkawka is a Polish word which means _hiccup_.
2020-10-06 09:30:44 +13:00
I chose this name because I wanted to hear people speaking other languages pronounce it.
This name is not as bad as it seems, because I was also thinking about using words like _żółć_, _gżegżółka_ or _żołądź_, but I gave up on these ideas because they contained Polish characters, which would cause difficulty in searching for the project.
2020-09-27 19:32:44 +13:00
2020-08-27 06:49:43 +12:00
## License
2020-09-05 09:09:11 +12:00
Code is distributed under MIT license.
2020-09-30 21:06:40 +13:00
Program is completely free to use.
"Gratis to uczciwa cena" - "Free is a fair price"