Giacomix02 / fanControl

fan control for hp victus
GNU General Public License v3.0
6 stars 1 forks source link

Linux compatibility #2

Open logan-keede opened 2 months ago

logan-keede commented 2 months ago

Hi There, I have Victus 15, and I found your repository while trying setup fan control for my debian, can you please add the installation method in Readme or here so i can try it out. Thanks

Giacomix02 commented 2 months ago

Hi, tanks for the Issue, i updated the readme, unfortunately the compiled release is only for windows and i can't do cross-compilation but you can download the code and compile yourself. If it works let me know and if you want send me the installation file for Linux Have a good day!

SolusJ commented 1 month ago

Ubuntu 22.04 The build was successful with the command below, but when executed, the message below appears.

Could not connect: Connection refused

The command that I used

git clone https://github.com/Giacomix02/fanControl.git
cd fanControl

sudo apt-get update
sudo apt-get install libsoup2.4-dev libjavascriptcoregtk-4.0-dev libatk1.0-dev libcairo2-dev libpango1.0-dev libgdk-pixbuf2.0-dev libgtk-3-dev libwebkit2gtk-4.0-dev

npm install
npm run tauri icon --icon src-tauri/icons/icon.ico

cd src-tauri
cargo update
cargo clean
cargo build --release
Giacomix02 commented 1 month ago

This is a very strange issue, the app can work also offline because it doesn't call external services/servers on internet. Probably it can't reach its localhost. Maybe the app can't call tauri. Also this app use powershell to excecute scripts to send to BIOS, doing this route: js -> rust -> powershell

This is the Rust function to enable fan boost

#[tauri::command]
fn turbo_on(app_handle: tauri::AppHandle){

    print!("\n\tTURBO ON\n");

    let path = path(app_handle);

    //print!("\n\t{}\n", path);

    let output = Command::new("powershell.exe")
        .arg("-ExecutionPolicy")
        .arg("Bypass")
        .arg("-Command")
        .arg(format!("Start-Process powershell.exe -Verb RunAs -ArgumentList '-ExecutionPolicy Bypass -File \"{}\" -MaxFanSpeedOn' -WindowStyle Hidden", path))
        .output()
        .expect("failed to execute process");

    //show command output
    println!("{}", String::from_utf8_lossy(&output.stdout));
}

I don't know if in Linux environment could work without any changes Let me know, have a good day!

SolusJ commented 1 month ago

I managed to add the code to display the UI on Linux, but the functionality didn't work since the OmenHwCtl project only supports Windows PowerShell. It seems beyond my current skills to modify it. Thank you for your understanding. This is a great project, and I will definitely try it out on Windows!

Giacomix02 commented 1 month ago

There is a solution that I also thought of implementing some time ago, that also resolve the problem of using windows powershell. The solution is to rewrite all the OmenHwCtl code interface to bios, or the parts that I need, in Rust. I think that with a little study and a lots of tests it is possible to create a great multiplatform app Thank you too for your interest