Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
52e423f
Add SteamVR fastlaunch command
Iemand005 Aug 21, 2025
d407877
Add quick launch setting toggle
Iemand005 Aug 21, 2025
fc58f3c
Setting name change
Iemand005 Aug 21, 2025
4f80cd5
Fix SteamVR naming
Iemand005 Aug 21, 2025
50f860b
Add description for SteamVR Quick Launch
Iemand005 Aug 21, 2025
2475d5e
temp
Iemand005 Aug 21, 2025
4538864
test
Iemand005 Aug 21, 2025
bea8672
SteamVR dynamic root dir
Iemand005 Aug 21, 2025
1dc3efb
Add default path fallback
Iemand005 Aug 21, 2025
152e0ee
SteamVR Launcher bug fix. Quick Launch tested working on Windows
Iemand005 Aug 21, 2025
c3a7b14
Foxes for Linux
Iemand005 Aug 21, 2025
7dc99d2
Fixes for macOS
Iemand005 Aug 21, 2025
06629ed
Document formatting fix
Iemand005 Aug 21, 2025
f73a536
Fix small warning
Iemand005 Aug 21, 2025
d964441
Hard code back app ID
Iemand005 Aug 21, 2025
253962a
Fix missing function for Linux
Iemand005 Aug 21, 2025
b6a5c4f
Formatting
Iemand005 Aug 21, 2025
499a2d8
Remove unused import
Iemand005 Aug 21, 2025
24bd5b6
Use Switch for SteamVR path
Iemand005 Aug 22, 2025
363caec
Formatting
Iemand005 Aug 22, 2025
b1cc710
Add label for executable path
Iemand005 Aug 22, 2025
10f7b00
Name change
Iemand005 Aug 22, 2025
1aa746a
Auto launch clarification and naming consistency
Iemand005 Aug 22, 2025
addc2d6
Small code adjustments
Iemand005 Aug 27, 2025
6bb2eac
Formatting
Iemand005 Aug 27, 2025
616bb10
Small fix
Iemand005 Aug 27, 2025
abb0352
Remove redundant description
Iemand005 Sep 1, 2025
d9b8c81
Small fix
Iemand005 Sep 1, 2025
773b70a
Imports cleanup
Iemand005 Sep 1, 2025
2224ed8
Refactor SteamVR launch function
Iemand005 Sep 6, 2025
e623699
Refactor SteamVR quick launch optimization
Iemand005 Sep 7, 2025
fdbf3e2
parameter fix
Iemand005 Sep 7, 2025
f210a6a
Formatting
Iemand005 Sep 7, 2025
0e73da5
Merge branch 'master' into master
zmerp Sep 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions alvr/dashboard/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,11 @@ fn main() {

data_sources::clean_session();

if data_sources::get_read_only_local_session()
.settings()
.extra
.steamvr_launcher
.open_close_steamvr_with_dashboard
{
steamvr_launcher::LAUNCHER.lock().launch_steamvr()
let session = data_sources::get_read_only_local_session();
let steamvr_settings = &session.settings().extra.steamvr_launcher;

if steamvr_settings.open_close_steamvr_with_dashboard {
steamvr_launcher::LAUNCHER.lock().launch_steamvr();
}

let ico = IconDir::read(Cursor::new(include_bytes!("../resources/dashboard.ico"))).unwrap();
Expand Down
16 changes: 3 additions & 13 deletions alvr/dashboard/src/steamvr_launcher/linux_steamvr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use alvr_common::{debug, error, info, warn};
use sysinfo::Process;

pub fn start_steamvr() {
pub fn launch_steam_app(app_id: &str) {
Command::new("steam")
.args(["steam://rungameid/250820"])
.args([format!("steam://rungameid/{}", app_id).as_str()])
.spawn()
.ok();
}
Expand Down Expand Up @@ -149,17 +149,7 @@
});
debug!("have_intel_dgpu: {}", have_intel_dgpu);

let steamvr_root_dir = match alvr_server_io::steamvr_root_dir() {
Ok(dir) => dir,
Err(e) => {
error!(
"Couldn't detect openvr or steamvr files. \
Please make sure you have installed and ran SteamVR at least once. \
Or if you're using Flatpak Steam, make sure to use ALVR Dashboard from Flatpak ALVR. {e}"
);
return;
}
};
let steamvr_root_dir = get_steamvr_root_dir();

Check failure on line 152 in alvr/dashboard/src/steamvr_launcher/linux_steamvr.rs

View workflow job for this annotation

GitHub Actions / check-linux

error[E0425]: cannot find function `get_steamvr_root_dir` in this scope --> alvr/dashboard/src/steamvr_launcher/linux_steamvr.rs:152:28 | 152 | let steamvr_root_dir = get_steamvr_root_dir(); | ^^^^^^^^^^^^^^^^^^^^ not found in this scope | help: consider importing this function | 1 + use crate::steamvr_launcher::get_steamvr_root_dir; |

let vrmonitor_path_string = steamvr_root_dir
.join("bin")
Expand Down
70 changes: 64 additions & 6 deletions alvr/dashboard/src/steamvr_launcher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ mod linux_steamvr;
#[cfg(windows)]
mod windows_steamvr;

use std::{path::PathBuf, process::Command};

use crate::data_sources;
use alvr_adb::commands as adb;
use alvr_common::{
anyhow::{Context, Result},
debug,
debug, error,
glam::bool,
parking_lot::Mutex,
warn,
Expand Down Expand Up @@ -107,6 +109,39 @@ fn unblock_alvr_driver_within_vrsettings(text: &str) -> Result<String> {
Ok(serde_json::to_string_pretty(&settings)?)
}

fn get_steamvr_root_dir() -> PathBuf {
match alvr_server_io::steamvr_root_dir() {
Ok(dir) => dir,
Err(e) => {
error!(
"Couldn't detect openvr or steamvr files. \
Please make sure you have installed and ran SteamVR at least once. \
Or if you're using Flatpak Steam, make sure to use ALVR Dashboard from Flatpak ALVR. {e}"
);
"".into()
}
}
}

pub fn get_default_steamvr_executable_path() -> String {
#[cfg(windows)]
return get_steamvr_root_dir()
.join("bin")
.join("win64")
.join("vrstartup.exe")
.into_os_string()
.into_string()
.unwrap();

#[cfg(not(windows))]
return get_steamvr_root_dir()
.join("bin")
.join("vrstartup.sh") // Adjust this to match actual entry point for Linux
.into_os_string()
.into_string()
.unwrap();
}

pub struct Launcher {
_phantom: PhantomData<()>,
}
Expand Down Expand Up @@ -156,11 +191,34 @@ impl Launcher {
if !is_steamvr_running() {
debug!("SteamVR is dead. Launching...");

#[cfg(windows)]
windows_steamvr::start_steamvr();

#[cfg(target_os = "linux")]
linux_steamvr::start_steamvr();
let session = data_sources::get_read_only_local_session();
let steamvr_settings = &session.settings().extra.steamvr_launcher;
let quick_launch = steamvr_settings.quick_launch_steamvr;
let steamvr_path = &steamvr_settings.steamvr_executable_path;
let default_steamvr_executable = get_default_steamvr_executable_path();

if quick_launch {
if PathBuf::from(steamvr_path).exists() {
debug!("Launching SteamVR from path: {}", steamvr_path);

Command::new(steamvr_path).spawn().ok();
} else {
warn!(
"SteamVR executable not found at path: {}. Trying default path.",
default_steamvr_executable
);

Command::new(default_steamvr_executable).spawn().ok();
}
} else {
let steamvr_app_id = "250820";

#[cfg(windows)]
windows_steamvr::launch_steam_app(steamvr_app_id);

#[cfg(target_os = "linux")]
linux_steamvr::launch_steam_app(steamvr_app_id);
}
}
}

Expand Down
8 changes: 6 additions & 2 deletions alvr/dashboard/src/steamvr_launcher/windows_steamvr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ use std::process::Command;

const CREATE_NO_WINDOW: u32 = 0x0800_0000;

pub fn start_steamvr() {
pub fn launch_steam_app(app_id: &str) {
Command::new("cmd")
.args(["/C", "start", "steam://rungameid/250820"])
.args([
"/C",
"start",
format!("steam://rungameid/{}", app_id).as_str(),
])
.creation_flags(CREATE_NO_WINDOW)
.spawn()
.ok();
Expand Down
14 changes: 14 additions & 0 deletions alvr/session/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1472,6 +1472,13 @@ pub struct LoggingConfig {
pub struct SteamvrLauncher {
#[schema(strings(display_name = "Open and close SteamVR with dashboard"))]
pub open_close_steamvr_with_dashboard: bool,
#[schema(strings(
display_name = "SteamVR Quick Launch",
help = "Launches SteamVR directly without Steam. This makes launching SteamVR significantly faster, allows SteamVR to be launched offline and avoids the \"app already running\" pop-up."
))]
pub quick_launch_steamvr: bool,
#[schema(strings(display_name = "SteamVR executable path"))]
pub steamvr_executable_path: String,
}

#[derive(SettingsSchema, Serialize, Deserialize, Clone)]
Expand Down Expand Up @@ -1513,6 +1520,7 @@ pub struct NewVersionPopupConfig {

#[derive(SettingsSchema, Serialize, Deserialize, Clone)]
pub struct ExtraConfig {
#[schema(strings(display_name = "SteamVR Launcher"))]
pub steamvr_launcher: SteamvrLauncher,
pub capture: CaptureConfig,
pub logging: LoggingConfig,
Expand Down Expand Up @@ -2133,6 +2141,12 @@ pub fn session_settings_default() -> SettingsDefault {
},
steamvr_launcher: SteamvrLauncherDefault {
open_close_steamvr_with_dashboard: false,
quick_launch_steamvr: false,
steamvr_executable_path: if cfg!(target_os = "windows") {
"C:\\Program Files (x86)\\Steam\\steamapps\\common\\SteamVR\\bin\\win64\\vrstartup.exe".into()
} else {
"~/.local/share/Steam/steamapps/common/SteamVR/bin/vrstartup.sh".into()
},
},
capture: CaptureConfigDefault {
startup_video_recording: false,
Expand Down
Loading