- Rust 69.4%
- Shell 30.6%
| src | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE.md | ||
| PKGBUILD | ||
| README.md | ||
floorlevel cli
A very simple CLI to set the floor level for Monado, the linux OpenXR runtime (and forks like WiVRn). This CLI can be used to quickly script things to automate your vr setup.
The heavy lifting here is already done by libmonado and the respective rust bindings. Have a look at src/main.rs to see how simple this really is!
usage
In general, the CLI should be self explanatory. Have a look at the help page to get started. Still, here are a few commands the CLI currently supports:
# print the current floor level
floorlevel get
# set the floor level to an absolute value of 69cm
floorlevel set 0.69
# lift and lower the floorlevel by 5cm
floorlevel modify 0.05
floorlevel modify -- -0.05
The absolute values are usually relative to your tracking origin.
wayvr example
As a quick example, here are a few widgets which you can add to your WayVR watch to store and load a specific floor level (FL) for certain use cases. If your tracking origin doesn't change between sessions, this should even persist accross them. To adjust the FL to new heights, you can still use WayVR's inbuilt floor level tool. So as a quick usage:
- Set an FL using WayVR's "fix floor" tool
- Save the current FL for a button by right clicking it (orange laser)
- At any later point in time, load the FL instantly by clicking on the button
To get started, you can refer to an excerpt from my WayVR config:
<!-- this template can be used to define a floor-level button -->
<template name="FloorLevel">
<Button
id="level_bed" macro="button_style" tooltip_side="left"
_press_left="::ShellExec floorlevel set $(cat ~/.config/wayvr/${id}-level.txt)"
_press_right="::ShellExec floorlevel get > ~/.config/wayvr/${id}-level.txt" tooltip_str="Set floor level to ${name}"
>
<sprite src="${icon}" width="24" height="24" />
</Button>
</template>
<!-- for example for three different floor level buttons -->
<div flex_direction="row" gap="8">
<div flex_direction="column" gap="8">
<FloorLevel icon="<path-to-bed-icon>" name="Bed" id="bed"/>
<FloorLevel icon="<path-to-chair-icon>" name="Chair" id="chair"/>
<FloorLevel icon="<path-to-floor-icon>" name="Floor" id="floor"/>
</div>
</div>
installation
To install this CLI, you can clone this repository and build it locally, then place the binary from target/release/floorlevel-cli into your path.
cargo build --release
Alternatively, if you are on Arch Linux, you can use the PKGBUILD in this repository.
license
This project is licensed under the GNU General Public License (Version 3). Refer to the LICENSE.md file for more information.