Skip to content
Ahm3dGI1Public

About

A fast, minimal file finder for the desktop, written in Rust.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gofi

A fast, minimal file finder for the desktop, written in Rust.

Gofi walks a directory once, caches the result, and lets you fuzzy-search it from a small always-on launcher window. Pick a result, hit Enter, and your OS opens the file with its default handler.

Features

  • Fuzzy matching via fuzzy-matcher (skim v2 algorithm)
  • Persistent cache — indexes once, reloads instantly on subsequent launches
  • Background search worker — typing never blocks the UI; stale queries are dropped
  • Keyboard-first — arrow keys to navigate, Enter to open, Esc to clear/minimize
  • Global hotkey — Alt+Space brings the window back to focus from anywhere
  • Cross-platform file opening — uses start (Windows), open (macOS), xdg-open (Linux)

Build

Requires a recent stable Rust toolchain (edition 2024).

cargo build --release

The binary lands at target/release/gofi (or gofi.exe on Windows).

Run

# Index and search the default root (D:/ on Windows)
cargo run --release

# Or point it at any directory
cargo run --release -- C:/Users/me/projects

The first launch walks the given directory and writes a cache to ./cache/file_hashes.bin. Delete that file to force a re-index.

Keyboard shortcuts

Key Action
Type Update search query
↑ / ↓ Move selection
Enter Open the selected file
Esc Clear query, or minimize if already empty
Alt+Space Global — restore and focus the window

How it works

  1. Indexing (src/indexing.rs) — walkdir visits every file under the root, producing an IndexedFile per entry. Entries are grouped by base filename into a HashMap<String, Vec<IndexedFile>> and serialized with bincode.
  2. Search (src/main.rs::fuzzy_search) — each unique base name is scored against the query once; every path sharing that name inherits the score, minus a small penalty for path depth (shallower files rank higher).
  3. Worker thread — the UI sends every keystroke into a crossbeam-channel. The worker drains the channel to skip stale queries and only runs the search for the newest one, writing results back through an Arc<Mutex<...>>.
  4. Hotkey (src/hotkey.rs) — rdev runs on a dedicated thread watching for Alt+Space, then sends ViewportCommand::Focus to the shared egui::Context.

Project layout

src/
  main.rs       # eframe app, search worker, file opener
  indexing.rs   # walkdir + bincode cache
  hotkey.rs     # global Alt+Space listener
cache/          # generated; gitignored

Known limitations

  • Index is a one-shot snapshot — files added after indexing won't appear until you delete the cache and relaunch.
  • The global hotkey uses rdev::listen, which on macOS and some Linux setups requires accessibility permissions.
  • No configuration file yet — root path is a positional CLI argument.

License

Not yet specified.

About

A fast, minimal file finder for the desktop, written in Rust.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages