fix wayvrctl
This commit is contained in:
@@ -105,6 +105,8 @@ pub async fn wvr_process_launch(
|
|||||||
exec: String,
|
exec: String,
|
||||||
name: String,
|
name: String,
|
||||||
env: Vec<String>,
|
env: Vec<String>,
|
||||||
|
resolution: [u32; 2],
|
||||||
|
icon: Option<String>,
|
||||||
args: String,
|
args: String,
|
||||||
userdata: HashMap<String, String>,
|
userdata: HashMap<String, String>,
|
||||||
) {
|
) {
|
||||||
@@ -118,6 +120,8 @@ pub async fn wvr_process_launch(
|
|||||||
exec,
|
exec,
|
||||||
name,
|
name,
|
||||||
args,
|
args,
|
||||||
|
resolution,
|
||||||
|
icon,
|
||||||
userdata,
|
userdata,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -119,10 +119,29 @@ async fn run_once(state: &mut WayVRClientState, args: Args) -> anyhow::Result<()
|
|||||||
exec,
|
exec,
|
||||||
name,
|
name,
|
||||||
env,
|
env,
|
||||||
|
resolution,
|
||||||
|
icon,
|
||||||
args,
|
args,
|
||||||
} => {
|
} => {
|
||||||
let env = env.split(",").map(|s| s.to_string()).collect::<Vec<_>>();
|
let env = env.split(",").map(|s| s.to_string()).collect::<Vec<_>>();
|
||||||
wvr_process_launch(state, exec, name, env, args, HashMap::new()).await;
|
let resolution = resolution
|
||||||
|
.split_once('x')
|
||||||
|
.and_then(|(x, y)| Some([x.parse::<u32>().ok()?, y.parse::<u32>().ok()?]))
|
||||||
|
.context(
|
||||||
|
"Invalid resolution format. Expecting <width>x<height>, for example: 1920x1080, 1280x720",
|
||||||
|
)?;
|
||||||
|
|
||||||
|
wvr_process_launch(
|
||||||
|
state,
|
||||||
|
exec,
|
||||||
|
name,
|
||||||
|
env,
|
||||||
|
resolution,
|
||||||
|
icon,
|
||||||
|
args,
|
||||||
|
HashMap::new(),
|
||||||
|
)
|
||||||
|
.await;
|
||||||
}
|
}
|
||||||
Subcommands::Haptics {
|
Subcommands::Haptics {
|
||||||
device,
|
device,
|
||||||
@@ -216,6 +235,9 @@ enum Subcommands {
|
|||||||
env: String,
|
env: String,
|
||||||
/// Executable to run
|
/// Executable to run
|
||||||
exec: String,
|
exec: String,
|
||||||
|
#[arg(default_value = "1920x1080")]
|
||||||
|
resolution: String,
|
||||||
|
icon: Option<String>,
|
||||||
/// Arguments to pass to executable
|
/// Arguments to pass to executable
|
||||||
#[arg(default_value = "")]
|
#[arg(default_value = "")]
|
||||||
args: String,
|
args: String,
|
||||||
|
|||||||
Reference in New Issue
Block a user