Skip to content

Commit

Permalink
feat: add get_current_shortcut tauri command (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
tu6ge authored Dec 16, 2024
1 parent 10f64bd commit 05b46ff
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub fn run() {
greet,
change_window_height,
change_shortcut,
get_current_shortcut,
change_autostart,
])
.setup(|app| {
Expand Down Expand Up @@ -136,6 +137,13 @@ fn change_shortcut<R: Runtime>(
Ok(())
}

#[tauri::command]
fn get_current_shortcut<R: Runtime>(app: tauri::AppHandle<R>) -> Result<String, String> {
let res = current_shortcut(&app)?;

Ok(res.into_string())
}

fn current_shortcut<R: Runtime>(app: &tauri::AppHandle<R>) -> Result<Shortcut, String> {
use std::fs::File;

Expand Down

0 comments on commit 05b46ff

Please # to comment.