feat: support hotkey (wip)

This commit is contained in:
GyDi
2022-09-14 01:19:02 +08:00
parent 3424c421a4
commit 09a1915ec6
8 changed files with 320 additions and 60 deletions

View File

@@ -213,7 +213,6 @@ pub fn patch_clash_config(payload: Mapping) -> CmdResult {
wrap_err!(core.patch_clash(payload))
}
/// get the verge config
#[tauri::command]
pub fn get_verge_config() -> CmdResult<Verge> {
let global = Data::global();
@@ -229,6 +228,13 @@ pub fn patch_verge_config(payload: Verge) -> CmdResult {
wrap_err!(core.patch_verge(payload))
}
#[tauri::command]
pub fn update_hotkeys(hotkeys: Vec<String>) -> CmdResult {
let core = Core::global();
let mut hotkey = core.hotkey.lock();
wrap_err!(hotkey.update(hotkeys))
}
/// change clash core
#[tauri::command]
pub fn change_clash_core(clash_core: Option<String>) -> CmdResult {