add flatpak manifest
This commit is contained in:
9
Cargo.lock
generated
9
Cargo.lock
generated
@@ -3009,8 +3009,8 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openxr"
|
name = "openxr"
|
||||||
version = "0.18.0"
|
version = "0.19.0"
|
||||||
source = "git+https://github.com/galister/openxrs?rev=af4a55d#af4a55df60125491c80c61464c824219c6019b76"
|
source = "git+https://github.com/Ralith/openxrs?rev=6c7747aee678048642dc16aad8bab3d6961dce03#6c7747aee678048642dc16aad8bab3d6961dce03"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"libloading",
|
"libloading",
|
||||||
@@ -3020,9 +3020,10 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openxr-sys"
|
name = "openxr-sys"
|
||||||
version = "0.10.0"
|
version = "0.11.0"
|
||||||
source = "git+https://github.com/galister/openxrs?rev=af4a55d#af4a55df60125491c80c61464c824219c6019b76"
|
source = "git+https://github.com/Ralith/openxrs?rev=6c7747aee678048642dc16aad8bab3d6961dce03#6c7747aee678048642dc16aad8bab3d6961dce03"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"cmake",
|
||||||
"libc",
|
"libc",
|
||||||
"mint",
|
"mint",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ json = { version = "0.12.4", optional = true }
|
|||||||
json5 = "0.4.1"
|
json5 = "0.4.1"
|
||||||
libc = "0.2.155"
|
libc = "0.2.155"
|
||||||
log = "0.4.21"
|
log = "0.4.21"
|
||||||
openxr = { git = "https://github.com/galister/openxrs", rev = "af4a55d", features = [
|
openxr = { git = "https://github.com/Ralith/openxrs", rev = "6c7747aee678048642dc16aad8bab3d6961dce03", features = [
|
||||||
"linked",
|
"static",
|
||||||
"mint",
|
"mint",
|
||||||
], optional = true }
|
], optional = true }
|
||||||
ovr_overlay = { features = [
|
ovr_overlay = { features = [
|
||||||
|
|||||||
65
flatpak/com.github.galister.wlx-overlay-s.yml
Normal file
65
flatpak/com.github.galister.wlx-overlay-s.yml
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
id: io.github.galister.wlx-overlay-s
|
||||||
|
runtime: org.freedesktop.Platform
|
||||||
|
runtime-version: '24.08'
|
||||||
|
sdk: org.freedesktop.Sdk
|
||||||
|
sdk-extensions:
|
||||||
|
- org.freedesktop.Sdk.Extension.rust-stable
|
||||||
|
- org.freedesktop.Sdk.Extension.llvm19
|
||||||
|
command: wlx-overlay-s
|
||||||
|
|
||||||
|
build-options:
|
||||||
|
append-path: /usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm19/bin
|
||||||
|
append-ld-library-path: /usr/lib/sdk/llvm19/lib
|
||||||
|
|
||||||
|
finish-args:
|
||||||
|
# PipeWire & Notifications
|
||||||
|
- --socket=session-bus
|
||||||
|
# uinput requires device=all
|
||||||
|
- --device=all
|
||||||
|
# X11 + XShm access
|
||||||
|
- --share=ipc
|
||||||
|
- --socket=fallback-x11
|
||||||
|
# Wayland access
|
||||||
|
- --socket=wayland
|
||||||
|
# Pipewire
|
||||||
|
- --filesystem=xdg-run/pipewire-0
|
||||||
|
# Get the active OpenXR runtime
|
||||||
|
- --filesystem=xdg-config/openxr:ro
|
||||||
|
# WiVRn and Monado install locations
|
||||||
|
- --filesystem=/opt/wivrn:ro
|
||||||
|
- --filesystem=/opt/monado:ro
|
||||||
|
- --filesystem=/usr/lib/monado:ro
|
||||||
|
- --filesystem=/usr/lib64/monado:ro
|
||||||
|
- --filesystem=/usr/lib/wivrn:ro
|
||||||
|
- --filesystem=/usr/lib64/wivrn:ro
|
||||||
|
- --filesystem=/var/lib/flatpak/app/io.github.wivrn.wivrn:ro
|
||||||
|
- --filesystem=~/.var/app/io.github.wivrn.wivrn:ro
|
||||||
|
- --filesystem=xdg-data/envision/prefixes:ro
|
||||||
|
# Access WiVRn/Monado sockets
|
||||||
|
- --filesystem=xdg-run/wivrn:ro
|
||||||
|
- --filesystem=xdg-run/monado_comp_ipc:ro
|
||||||
|
- --filesystem=/tmp/wlx.log:create
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
- /lib/pkgconfig
|
||||||
|
- /share/pkgconfig
|
||||||
|
- /include
|
||||||
|
- /share/man
|
||||||
|
- '*.a'
|
||||||
|
|
||||||
|
modules:
|
||||||
|
# wayvr goes here
|
||||||
|
- name: wlx-overlay-s
|
||||||
|
buildsystem: simple
|
||||||
|
build-options:
|
||||||
|
env:
|
||||||
|
CARGO_HOME: /run/build/wlx-overlay-s/cargo
|
||||||
|
build-commands:
|
||||||
|
- cargo --offline fetch --manifest-path Cargo.toml --verbose
|
||||||
|
- cargo --offline build --release --no-default-features --features=openxr,x11,wayland --verbose
|
||||||
|
- install -Dm755 ./target/release/wlx-overlay-s -t /app/bin/
|
||||||
|
sources:
|
||||||
|
- type: dir
|
||||||
|
path: ..
|
||||||
|
- sources-wlx-overlay-s.json
|
||||||
|
|
||||||
7459
flatpak/sources-wlx-overlay-s.json
Executable file
7459
flatpak/sources-wlx-overlay-s.json
Executable file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
use anyhow::{bail, ensure};
|
use anyhow::{bail, ensure};
|
||||||
use glam::{Affine3A, Quat, Vec3, Vec3A};
|
use glam::{Affine3A, Quat, Vec3, Vec3A};
|
||||||
use openxr::{self as xr, SessionCreateFlags};
|
use openxr::{self as xr, SessionCreateFlags, Version};
|
||||||
use xr::OverlaySessionCreateFlagsEXTX;
|
use xr::OverlaySessionCreateFlagsEXTX;
|
||||||
|
|
||||||
pub(super) fn init_xr() -> Result<(xr::Instance, xr::SystemId), anyhow::Error> {
|
pub(super) fn init_xr() -> Result<(xr::Instance, xr::SystemId), anyhow::Error> {
|
||||||
@@ -54,6 +54,7 @@ pub(super) fn init_xr() -> Result<(xr::Instance, xr::SystemId), anyhow::Error> {
|
|||||||
|
|
||||||
let Ok(xr_instance) = entry.create_instance(
|
let Ok(xr_instance) = entry.create_instance(
|
||||||
&xr::ApplicationInfo {
|
&xr::ApplicationInfo {
|
||||||
|
api_version: Version::new(1, 1, 37),
|
||||||
application_name: "wlx-overlay-s",
|
application_name: "wlx-overlay-s",
|
||||||
application_version: 0,
|
application_version: 0,
|
||||||
engine_name: "wlx-overlay-s",
|
engine_name: "wlx-overlay-s",
|
||||||
|
|||||||
19
src/main.rs
19
src/main.rs
@@ -34,6 +34,7 @@ use std::{
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use backend::notifications::DbusNotificationSender;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use sysinfo::Pid;
|
use sysinfo::Pid;
|
||||||
use tracing::level_filters::LevelFilter;
|
use tracing::level_filters::LevelFilter;
|
||||||
@@ -127,12 +128,17 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unused_mut)]
|
||||||
fn auto_run(running: Arc<AtomicBool>, args: Args) {
|
fn auto_run(running: Arc<AtomicBool>, args: Args) {
|
||||||
use backend::common::BackendError;
|
use backend::common::BackendError;
|
||||||
|
|
||||||
|
let mut tried_xr = false;
|
||||||
|
let mut tried_vr = false;
|
||||||
|
|
||||||
#[cfg(feature = "openxr")]
|
#[cfg(feature = "openxr")]
|
||||||
if !args_get_openvr(&args) {
|
if !args_get_openvr(&args) {
|
||||||
use crate::backend::openxr::openxr_run;
|
use crate::backend::openxr::openxr_run;
|
||||||
|
tried_xr = true;
|
||||||
match openxr_run(running.clone(), args.show) {
|
match openxr_run(running.clone(), args.show) {
|
||||||
Ok(()) => return,
|
Ok(()) => return,
|
||||||
Err(BackendError::NotSupported) => (),
|
Err(BackendError::NotSupported) => (),
|
||||||
@@ -146,6 +152,7 @@ fn auto_run(running: Arc<AtomicBool>, args: Args) {
|
|||||||
#[cfg(feature = "openvr")]
|
#[cfg(feature = "openvr")]
|
||||||
if !args_get_openxr(&args) {
|
if !args_get_openxr(&args) {
|
||||||
use crate::backend::openvr::openvr_run;
|
use crate::backend::openvr::openvr_run;
|
||||||
|
tried_vr = true;
|
||||||
match openvr_run(running, args.show) {
|
match openvr_run(running, args.show) {
|
||||||
Ok(()) => return,
|
Ok(()) => return,
|
||||||
Err(BackendError::NotSupported) => (),
|
Err(BackendError::NotSupported) => (),
|
||||||
@@ -158,6 +165,18 @@ fn auto_run(running: Arc<AtomicBool>, args: Args) {
|
|||||||
|
|
||||||
log::error!("No more backends to try");
|
log::error!("No more backends to try");
|
||||||
|
|
||||||
|
let instructions = match (tried_xr, tried_vr) {
|
||||||
|
(true, true) => "Make sure that Monado, WiVRn or SteamVR is running.",
|
||||||
|
(false, true) => "Make sure that SteamVR is running.",
|
||||||
|
(true, false) => "Make sure that Monado or WiVRn is running.",
|
||||||
|
_ => "Check your launch arguments.",
|
||||||
|
};
|
||||||
|
|
||||||
|
let instructions = format!("Could not connect to runtime.\n{instructions}");
|
||||||
|
|
||||||
|
let _ = DbusNotificationSender::new()
|
||||||
|
.and_then(|s| s.notify_send("WlxOverlay-S", &instructions, 1, 0, 0, false));
|
||||||
|
|
||||||
#[cfg(not(any(feature = "openvr", feature = "openxr")))]
|
#[cfg(not(any(feature = "openvr", feature = "openxr")))]
|
||||||
compile_error!("No VR support! Enable either openvr or openxr features!");
|
compile_error!("No VR support! Enable either openvr or openxr features!");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user