Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add linux support 🚀 #32

Open
ParthJadhav opened this issue Jan 9, 2023 · 2 comments
Open

add linux support 🚀 #32

ParthJadhav opened this issue Jan 9, 2023 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed Linux

Comments

@ParthJadhav
Copy link
Owner

Changes required:

  1. Changing this to include linux release.

    "targets": ["app"],

  2. 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);
    }

  3. 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");
    }

  4. 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();

  5. 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);
    }
    }
    }

  6. 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...

@ParthJadhav ParthJadhav added enhancement New feature or request help wanted Extra attention is needed Linux labels Jan 9, 2023
@matbgn
Copy link

matbgn commented May 18, 2023

Would really love to test it on Linux 😄

@ParthJadhav
Copy link
Owner Author

Would really love to test it on Linux 😄

That would be amazing !! I'm not planning to take it up soon, feel free to look around & experiment stuff😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed Linux
Projects
None yet
Development

No branches or pull requests

2 participants