38 lines
1.1 KiB
Rust
38 lines
1.1 KiB
Rust
mod commands;
|
|
pub mod screenshot;
|
|
pub mod shortcut;
|
|
mod state;
|
|
pub mod utils;
|
|
mod window;
|
|
|
|
use state::new_shared_watcher_state;
|
|
use window::setup_window;
|
|
|
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
|
pub fn run() {
|
|
let watcher_state = new_shared_watcher_state();
|
|
|
|
tauri::Builder::default()
|
|
.plugin(tauri_plugin_store::Builder::new().build())
|
|
.plugin(tauri_plugin_http::init())
|
|
// .plugin(tauri_plugin_dialog::init())
|
|
// .plugin(tauri_plugin_opener::init())
|
|
.manage(watcher_state)
|
|
.invoke_handler(tauri::generate_handler![
|
|
commands::handle_selected_folder,
|
|
shortcut::change_shortcut,
|
|
shortcut::unregister_shortcut,
|
|
shortcut::get_current_shortcut,
|
|
shortcut::change_screenshot_shortcut,
|
|
shortcut::unregister_screenshot_shortcut,
|
|
shortcut::get_current_screenshot_shortcut,
|
|
])
|
|
.setup(|app| {
|
|
setup_window(app)?;
|
|
|
|
Ok(())
|
|
})
|
|
.run(tauri::generate_context!())
|
|
.expect("error while running tauri application");
|
|
}
|