mirror of
https://github.com/ByteAtATime/raycast-linux.git
synced 2025-09-12 00:46:22 +00:00
feat: implement getSelectedText function
Previously, this function was a shell that always rejected. This commit implements the schemas for a new get-selected-text command and updates the SidecarMessageWithPluginsSchema to include the new message type.
This commit is contained in:
parent
c91a800e80
commit
a5a39a5b7d
7 changed files with 493 additions and 42 deletions
|
@ -1,5 +1,6 @@
|
|||
use freedesktop_file_parser::{parse, EntryType};
|
||||
use rayon::prelude::*;
|
||||
use selection::get_text;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
|
@ -236,13 +237,22 @@ fn launch_app(exec: String) -> Result<(), String> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn get_selected_text() -> String {
|
||||
get_text()
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_shell::init())
|
||||
.plugin(tauri_plugin_clipboard_manager::init())
|
||||
.plugin(tauri_plugin_opener::init())
|
||||
.invoke_handler(tauri::generate_handler![get_installed_apps, launch_app])
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
get_installed_apps,
|
||||
launch_app,
|
||||
get_selected_text
|
||||
])
|
||||
.setup(|_app| {
|
||||
thread::spawn(|| {
|
||||
thread::sleep(Duration::from_secs(60));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue