mirror of
https://github.com/ByteAtATime/raycast-linux.git
synced 2025-09-12 00:46:22 +00:00
feat(file-search): implement file and folder search with indexing
This commit adds a basic file search feature, allowing users to find files and folders within their home directory. The backend consists of a Rust module that builds and maintains a SQLite index of the file system. It performs an initial scan and then uses the `notify` crate to watch for real-time changes. On the frontend, a new Svelte view provides a dedicated UI for searching. It displays results, file details, and an action bar with options to open the file/folder, show it in the native file manager, copy its path, or move it to the trash.
This commit is contained in:
parent
a561534075
commit
e2316cf949
13 changed files with 785 additions and 6 deletions
|
@ -12,6 +12,7 @@ mod oauth;
|
|||
mod quicklinks;
|
||||
mod snippets;
|
||||
mod system;
|
||||
mod file_search;
|
||||
|
||||
use crate::snippets::input_manager::{EvdevInputManager, InputManager};
|
||||
use crate::{app::App, cache::AppCache};
|
||||
|
@ -140,7 +141,7 @@ fn setup_global_shortcut(app: &mut tauri::App) -> Result<(), Box<dyn std::error:
|
|||
.with_handler(move |_app, shortcut, event| {
|
||||
println!("Shortcut: {:?}, Event: {:?}", shortcut, event);
|
||||
if shortcut == &spotlight_shortcut && event.state() == ShortcutState::Pressed {
|
||||
let spotlight_window = handle.get_webview_window("raycast-linux").unwrap();
|
||||
let spotlight_window = handle.get_webview_window("main").unwrap();
|
||||
println!("Spotlight window: {:?}", spotlight_window);
|
||||
if spotlight_window.is_visible().unwrap_or(false) {
|
||||
spotlight_window.hide().unwrap();
|
||||
|
@ -245,7 +246,8 @@ pub fn run() {
|
|||
snippets::delete_snippet,
|
||||
snippets::import_snippets,
|
||||
snippets::paste_snippet_content,
|
||||
snippets::snippet_was_used
|
||||
snippets::snippet_was_used,
|
||||
file_search::search_files
|
||||
])
|
||||
.setup(|app| {
|
||||
let app_handle = app.handle().clone();
|
||||
|
@ -265,6 +267,9 @@ pub fn run() {
|
|||
snippet_manager.init_db()?;
|
||||
app.manage(snippet_manager);
|
||||
|
||||
let app_handle_for_file_search = app.handle().clone();
|
||||
file_search::init(app_handle_for_file_search);
|
||||
|
||||
setup_background_refresh();
|
||||
setup_global_shortcut(app)?;
|
||||
setup_input_listener(app.handle());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue