Changes required:
-
Changing this to include linux release.
-
Changing the paths below to work for Linux file system, Might need to research a bit on how to add platform specific logic. Creating a struct with the platform specific paths would be a good idea.
|
pub async fn handle_input(input: String) -> (Vec<String>, f32, i32) { |
|
let mut result: Vec<String>; |
|
let mut result_type: ResultType; |
|
let start_time = Instant::now(); |
|
if !input.starts_with("/") { |
|
result = search( |
|
input.as_str(), |
|
vec![ |
|
"/Applications", |
|
"/System/Applications", |
|
"/System/Applications/Utilities", |
|
], |
|
Some(".app"), |
|
Some(1), |
|
); |
|
similarity_sort(&mut result, input.as_str()); |
|
result_type = ResultType::Applications; |
|
} else { |
|
result = search( |
|
input.trim_start_matches("/"), |
|
vec!["/Users/"], |
|
None, |
|
Some(10000), |
|
); |
|
println!("{:?}", result); |
|
result_type = ResultType::Files; |
|
} |
|
if result.len() == 0 { |
|
let calculation_result = calculate(input.as_str()); |
|
if calculation_result != "" { |
|
result.push(calculation_result); |
|
result_type = ResultType::Calculation; |
|
} |
|
} |
|
let time_taken = start_time.elapsed().as_secs_f32(); |
|
return (result, time_taken, result_type as i32); |
|
} |
-
Might need to update the command below to support opening apps on linux.
|
#[tauri::command] |
|
pub fn open_command(path: &str) { |
|
Command::new("open") |
|
.arg(path.trim()) |
|
.spawn() |
|
.expect("failed to execute process"); |
|
} |
-
Below Path may also need updation:
|
#[tauri::command] |
|
pub fn launch_on_login(enable: bool) -> bool { |
|
let auto = AutoLaunchBuilder::new() |
|
.set_app_name("verve") |
|
.set_app_path("/Applications/verve.app") |
|
.build() |
|
.unwrap(); |
-
Might need to figure out how to derive icons on linux systems...
|
pub fn convert_all_app_icons_to_png() { |
|
let result: Vec<String> = SearchBuilder::default() |
|
.location("/Applications") |
|
.more_locations(vec![ |
|
"/System/Applications", |
|
"/System/Applications/Utilities", |
|
]) |
|
.depth(1) |
|
.ext(".app") |
|
.ignore_case() |
|
.build() |
|
.collect(); |
|
for app_path in result { |
|
let app_name = app_path.split("/").last().unwrap(); |
|
let icon_path = get_icon_path(&app_path); |
|
if icon_path != "" { |
|
convert_and_store_icons(&icon_path, app_name); |
|
} |
|
} |
|
} |
-
This shortcut might need to be updated to META + Shift + G
|
shortcut: String::from("Command+Shift+G"), |
|
shortcutArray = ["Command", "Shift", "G"]; |
|
.map((key) => key) |
|
.join(" + ") |
|
.replace("Meta", "⌘") |
|
.replace("Command", "⌘") |
|
.replace("Control", "⌃") |
|
.replace("Alt", "⌥") |
|
.replace("Shift", "⇧") |
There might be more changes, Depending on the arising issues. Please do ping below if you want to create sub-issues for all of those...
Changes required:
Changing this to include linux release.
Verve/src-tauri/tauri.conf.json
Line 76 in d0f00a5
Changing the paths below to work for Linux file system, Might need to research a bit on how to add platform specific logic. Creating a struct with the platform specific paths would be a good idea.
Verve/src-tauri/src/util.rs
Lines 25 to 61 in d0f00a5
Might need to update the command below to support opening apps on linux.
Verve/src-tauri/src/util.rs
Lines 76 to 82 in d0f00a5
Below Path may also need updation:
Verve/src-tauri/src/util.rs
Lines 84 to 90 in d0f00a5
Might need to figure out how to derive icons on linux systems...
Verve/src-tauri/src/util/icons.rs
Lines 59 to 78 in d0f00a5
This shortcut might need to be updated to META + Shift + G
Verve/src-tauri/src/util/preferences.rs
Line 45 in d0f00a5
Verve/src/routes/Settings/lib/controls/ShortcutControl.svelte
Line 78 in d0f00a5
Verve/src/routes/Settings/lib/controls/ShortcutControl.svelte
Lines 97 to 103 in d0f00a5
There might be more changes, Depending on the arising issues. Please do ping below if you want to create sub-issues for all of those...