Skip to content

Commit

Permalink
fixed macOS build, and reinplemented ectool check
Browse files Browse the repository at this point in the history
	modified:   index.html
	modified:   src-tauri/src/main.rs
	modified:   src/main.js
	modified:   src/styles.css
  • Loading branch information
death7654 committed Nov 13, 2023
1 parent f209ed0 commit c4aa71c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
<h1>This Computer Is Not A Modified Chromebook<br><br>This App Works Best on Modified Chromebooks</h1>
</div>
<div id="noEctools" class="noEctools">
<h1 id="windows" class="windows">You Are Missing Coolstar's EC Driver</h1>
<h1 id="linux" class="linux">You Are Missing Ectool and Cbmem Binaries</h1>
<h1 id="windows" class="display">You Are Missing Coolstar's EC Driver</h1>
<h1 id="linux" class="display">You Are Missing Ectool and Cbmem Binaries</h1>
<h1 id="macos" class="display">You Are Missing Ectool Binary</h1>
</div>
<div id="blur">
<div data-tauri-drag-region class="appFrame">
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const EC: &str = "ectool";
#[cfg(windows)]
const EC: &str = "C:\\Program Files\\crosec\\ectool";
#[cfg(target_os = "macos")]
const EC: &str = "ectool"; //this needs to be figured out
const EC: &str = "/usr/local/bin/ectool";

#[cfg(target_os = "linux")]
const MEM: &str = "cbmem";
Expand Down
21 changes: 19 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,26 @@ async function startTempinterval(){
let tempInterval = setInterval(async() => {
startTempinterval()
}, 1000);
//stops ectools from trying to run and displays no ectools
setTimeout(async () => {
if(containsNumber(averageTemp) === true)
if(containsNumber(averageTemp) === false)
{
clearInterval(tempInterval);
document.getElementById('noEctools').style.display = "block";
if (os === "windows")
{
document.getElementById('windows').style.display = "flex";
}
else if (os === "macos")
{
document.getElementById('macos').style.display = "flex";
}
else
{
document.getElementById('linux').style.display = "flex";
}
}
console.log(os)
},1500)

let intervalStarted = false;
Expand Down Expand Up @@ -194,9 +209,10 @@ setTimeout(async () => {
document.getElementById("hostname").innerText = "Hostname: " + hostname;
document.getElementById("cpuName").innerText = "CPU: " + cpuname;

//checks if user is on a chromebook, and if they are in a chromebook checks if they have the necessary drivers installed per os
//checks if user is on a chromebook (except macos), and if they are in a chromebook checks if they have the necessary drivers installed per os
let manufacturer = await invoke("manufacturer");
manufacturer = manufacturer.toLowerCase();
if (os !== "macos"){
if (manufacturer !== "google") {
document.getElementById("blur").classList.add("blur");
document.getElementById("notChromebook").style.display = "flex";
Expand All @@ -207,6 +223,7 @@ setTimeout(async () => {
document.getElementById("notChromebook").style.display = "none";
});
}
}
//shows or hides activity light settings based on boardname (only shows to Candy and Kefka)
if(boardname !== "Candy" && boardname !== "Kefka")
{
Expand Down
6 changes: 1 addition & 5 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@
left: 30%;
display: none;
}
.noEctools .windows {
display: none;
align-items: center;
}
.noEctools .linux {
.noEctools .display {
display: none;
align-items: center;
}
Expand Down

0 comments on commit c4aa71c

Please sign in to comment.