bundle xwayland-satellite with appimage

This commit is contained in:
galister 2026-07-13 09:27:23 +09:00
parent 3f53904623
commit 6dfef92031
3 changed files with 30 additions and 1 deletions

View File

@ -29,6 +29,9 @@ jobs:
- name: Cargo Build
run: |
../.github/workflows/scripts/appimage_build_wlx.sh
- name: Build xwayland-satellite
run: |
../.github/workflows/scripts/appimage_build_satellite.sh
- name: Package AppImage
run: |
../.github/workflows/scripts/appimage_package.sh

View File

@ -0,0 +1,17 @@
#!/bin/sh
sudo apt install \
xwayland \
libxcb1-dev \
libxcb-cursor-dev \
clang \
pkg-config
git clone https://github.com/Supreeeme/xwayland-satellite.git
cd xwayland-satellite
cargo build --release
chmod +x ../target/release/xwayland-satellite
cd ..
cp xwayland-satellite/target/release/wayvr ${APPDIR}/usr/bin

View File

@ -1,4 +1,5 @@
use std::{
ffi::OsStr,
io::Read,
os::unix::net::UnixStream,
path::PathBuf,
@ -97,7 +98,7 @@ impl WayVRCompositor {
) -> anyhow::Result<Self> {
let (wayland_env, listener) = create_wayland_listener()?;
let xwayland_satellite = Command::new("xwayland-satellite")
let xwayland_satellite = Command::new(bundled_executable("xwayland-satellite"))
.arg(wayland_env.display_num_string())
.env("WAYLAND_DISPLAY", wayland_env.wayland_display_num_string())
.spawn()
@ -392,3 +393,11 @@ fn accumulate_discrete_scroll(acc: &mut f32, delta_v120: i32) -> i32 {
steps
}
/// Runs executable from APPDIR, falling back to PATH
fn bundled_executable(name: impl AsRef<std::path::Path>) -> PathBuf {
match std::env::var_os("APPDIR") {
Some(appdir) => PathBuf::from(appdir).join("usr").join("bin").join(name),
None => PathBuf::from(name.as_ref()),
}
}