Skip to content

Commit

Permalink
fix: update rust, add git_hash()
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Sep 6, 2024
1 parent 10d4f4b commit 185ada1
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 44 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ concurrency:

env:
CARGO_INCREMENTAL: 0
GIT_HASH: ${{ github.sha }}

jobs:
build:
Expand Down
46 changes: 8 additions & 38 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["SpikeHD"]
license = ""
repository = ""
edition = "2021"
rust-version = "1.77.2"
rust-version = "1.80"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down Expand Up @@ -53,7 +53,7 @@ wgpu = { version = "22", default-features = false }
[target.'cfg(target_os = "macos")'.dependencies]
objc = "0.2"
objc-foundation = "0.1.1"
cocoa = "0.25.0"
cocoa = "0.26.0"
block = "0.1.6"
embed_plist = "1.2.2"

Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/functionality/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rsrpc::{
RPCServer,
};
use std::sync::{Arc, Mutex};
use sysinfo::System;
use sysinfo::{ProcessRefreshKind, RefreshKind, System};
use tauri::Listener;
use window_titles::ConnectionTrait;

Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/functionality/streamer_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ pub fn start_streamer_mode_watcher(win: tauri::WebviewWindow) {
for process in system.processes().values() {
std::thread::sleep(std::time::Duration::from_millis(5));

if process.name().to_lowercase().contains("obs64")
|| process.name().to_lowercase().contains("streamlabs")
if process.name().to_ascii_lowercase().contains("obs64")
|| process.name().to_ascii_lowercase().contains("streamlabs")
{
// If OBS is running, we can break out of the loop and emit the event
obs_running = true;
Expand Down
10 changes: 9 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
windows_subsystem = "windows"
)]

use std::time::Duration;
use std::{sync::LazyLock, env, time::Duration};
use tauri::{Manager, WebviewWindowBuilder};
use tauri_plugin_window_state::{AppHandleExt, StateFlags, WindowExt};

Expand Down Expand Up @@ -38,6 +38,13 @@ mod release;
mod util;
mod window;

static GIT_HASH: LazyLock<&str> = LazyLock::new(|| option_env!("GIT_HASH").unwrap_or("Unknown"));

#[tauri::command]
fn git_hash() -> String {
GIT_HASH.to_string()
}

#[tauri::command]
fn should_disable_plugins() -> bool {
std::env::args().any(|arg| arg == "--disable-plugins")
Expand Down Expand Up @@ -116,6 +123,7 @@ fn main() {
.plugin(tauri_plugin_window_state::Builder::new().build())
.invoke_handler(tauri::generate_handler![
should_disable_plugins,
git_hash,
functionality::window::minimize,
functionality::window::toggle_maximize,
functionality::window::set_decorations,
Expand Down

0 comments on commit 185ada1

Please sign in to comment.