Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 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
8 changes: 4 additions & 4 deletions alvr/dashboard/src/steamvr_launcher/linux_steamvr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use alvr_common::anyhow::bail;
use alvr_common::{debug, error, info, warn};
use sysinfo::Process;

pub fn start_steamvr() {
pub fn launch_steamvr_with_steam() {
Command::new("steam")
.args(["steam://rungameid/250820"])
.spawn()
Expand Down Expand Up @@ -153,9 +153,9 @@ fn linux_gpu_checks(device_infos: &[(&wgpu::Adapter, DeviceInfo)]) {
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}"
"Couldn't find 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;
}
Expand Down
56 changes: 50 additions & 6 deletions alvr/dashboard/src/steamvr_launcher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ 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,
};
use alvr_filesystem as afs;
use serde_json::{self, json};
use settings_schema::Switch;
use std::{
ffi::OsStr,
fs,
Expand Down Expand Up @@ -107,6 +110,23 @@ fn unblock_alvr_driver_within_vrsettings(text: &str) -> Result<String> {
Ok(serde_json::to_string_pretty(&settings)?)
}

pub fn get_default_steamvr_executable_path() -> String {
let steamvr_root_dir = alvr_server_io::steamvr_root_dir()
.map_err(|e| error!("Couldn't find OpenVR or SteamVR files. {e}"))
.unwrap_or_default();

let steamvr_path = if cfg!(windows) {
steamvr_root_dir
.join("bin")
.join("win64")
.join("vrstartup.exe")
} else {
steamvr_root_dir.join("bin").join("vrmonitor.sh")
};

steamvr_path.into_os_string().into_string().unwrap()
}

pub struct Launcher {
_phantom: PhantomData<()>,
}
Expand Down Expand Up @@ -156,11 +176,35 @@ 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();
if let Switch::Enabled(steamvr_path) = &data_sources::get_read_only_local_session()
.settings()
.extra
.steamvr_launcher
.use_steamvr_path
{
let steamvr_path = &steamvr_path.steamvr_executable_path_override;

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

Command::new(steamvr_path).spawn().ok();
} else {
let default_steamvr_executable = get_default_steamvr_executable_path();

warn!(
"SteamVR executable not found at path: {}. Trying default path.",
default_steamvr_executable
);

Command::new(default_steamvr_executable).spawn().ok();
}
} else {
#[cfg(windows)]
windows_steamvr::launch_steamvr_with_steam();

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

Expand Down
2 changes: 1 addition & 1 deletion alvr/dashboard/src/steamvr_launcher/windows_steamvr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::process::Command;

const CREATE_NO_WINDOW: u32 = 0x0800_0000;

pub fn start_steamvr() {
pub fn launch_steamvr_with_steam() {
Command::new("cmd")
.args(["/C", "start", "steam://rungameid/250820"])
.creation_flags(CREATE_NO_WINDOW)
Expand Down
27 changes: 26 additions & 1 deletion alvr/session/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1468,10 +1468,24 @@ pub struct LoggingConfig {
pub debug_groups: DebugGroupsConfig,
}

#[derive(SettingsSchema, Serialize, Deserialize, Clone)]
pub struct SteamvrQuickLaunchConfig {
#[schema(strings(display_name = "SteamVR executable path"))]
pub steamvr_executable_path_override: String,
}

#[derive(SettingsSchema, Serialize, Deserialize, Clone)]
pub struct SteamvrLauncher {
#[schema(strings(display_name = "Open and close SteamVR with dashboard"))]
#[schema(strings(
display_name = "Open and close SteamVR automatically",
help = "Launches SteamVR automatically when the ALVR dashboard is opened, and closes it when the dashboard is closed."
))]
pub open_close_steamvr_with_dashboard: bool,
#[schema(strings(
display_name = "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 use_steamvr_path: Switch<SteamvrQuickLaunchConfig>,
}

#[derive(SettingsSchema, Serialize, Deserialize, Clone)]
Expand Down Expand Up @@ -1513,6 +1527,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 +2148,16 @@ pub fn session_settings_default() -> SettingsDefault {
},
steamvr_launcher: SteamvrLauncherDefault {
open_close_steamvr_with_dashboard: false,
use_steamvr_path: SwitchDefault {
enabled: false,
content: SteamvrQuickLaunchConfigDefault {
steamvr_executable_path_override: if cfg!(target_os = "windows") {
r"C:\Program Files (x86)\Steam\steamapps\common\SteamVR\bin\win64\vrstartup.exe".into()
} else {
"".into()
},
},
},
},
capture: CaptureConfigDefault {
startup_video_recording: false,
Expand Down
Loading