Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
# Builds and tests run dependency code; only windows-build needs write access.
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Linux HID and GUI dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libudev-dev libgtk-3-dev libayatana-appindicator3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev libgl1-mesa-dev pkg-config
Expand All @@ -33,15 +38,21 @@ jobs:
- name: Check formatting
if: runner.os == 'Linux'
run: cargo fmt --check
- name: Test
run: cargo test --locked
- name: Clippy
run: cargo clippy --locked --all-targets -- -D warnings
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- name: Test installer script
if: runner.os == 'Linux'
run: |
bash -n install-linux.sh
bash tests/linux_startup.sh "${{ runner.temp }}"
bash install-linux.sh --help
bash -c 'export HOME=/root OPENMOUSE_INSTALL_SOURCED=1; source ./install-linux.sh; D=$(mktemp -d); write_udev_rule "$D/rule"; bodies=$(grep -c "SUBSYSTEM" "$D/rule"); vids=$(printf "%s" "$VENDOR_IDS" | wc -w); [ "$bodies" = "$vids" ] || exit 1; write_autostart "$D/a.desktop" "/opt/x/b"; grep -q "Exec=\"/opt/x/b\"" "$D/a.desktop"; write_launcher "$D/l.desktop" "/opt/x/b" "/opt/x/i.png"; grep -q "^Name=OpenMouse Bridge$" "$D/l.desktop"; grep -q "^Terminal=false$" "$D/l.desktop"; for pm in apt dnf pacman zypper apk; do pm_packages "$pm" | grep -q curl || exit 1; done; rm -rf "$D"'

windows-build:
name: Windows release artifact
needs: check
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -71,7 +82,8 @@ jobs:
- name: Package
shell: pwsh
run: |
Compress-Archive -Path target/release/openmouse-bridge.exe,README.md,native-hid -DestinationPath openmouse-bridge-windows-x64.zip
Copy-Item assets/fonts/DM-Sans-OFL.txt DM-Sans-OFL.txt
Compress-Archive -Path target/release/openmouse-bridge.exe,README.md,DM-Sans-OFL.txt,native-hid -DestinationPath openmouse-bridge-windows-x64.zip
(Get-FileHash openmouse-bridge-windows-x64.zip -Algorithm SHA256).Hash.ToLower() + " openmouse-bridge-windows-x64.zip" | Set-Content openmouse-bridge-windows-x64.zip.sha256
- uses: actions/upload-artifact@v4
with:
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
cache-dependency-path: native-hid/package-lock.json
- run: cargo fmt --check
- run: cargo test --locked
- run: cargo clippy --locked --all-targets -- -D warnings
- run: cargo build --release --locked
- name: Sign executable
if: env.WINDOWS_CERTIFICATE_BASE64 != ''
Expand All @@ -55,7 +59,8 @@ jobs:
- name: Package
shell: pwsh
run: |
Compress-Archive -Path target/release/openmouse-bridge.exe,README.md,native-hid -DestinationPath openmouse-bridge-windows-x64.zip
Copy-Item assets/fonts/DM-Sans-OFL.txt DM-Sans-OFL.txt
Compress-Archive -Path target/release/openmouse-bridge.exe,README.md,DM-Sans-OFL.txt,native-hid -DestinationPath openmouse-bridge-windows-x64.zip
(Get-FileHash openmouse-bridge-windows-x64.zip -Algorithm SHA256).Hash.ToLower() + " openmouse-bridge-windows-x64.zip" | Set-Content openmouse-bridge-windows-x64.zip.sha256
- uses: actions/upload-artifact@v4
with:
Expand All @@ -71,14 +76,17 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
targets: aarch64-apple-darwin,x86_64-apple-darwin
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
cache-dependency-path: native-hid/package-lock.json
- run: cargo fmt --check
- run: cargo test --locked
- run: cargo clippy --locked --all-targets -- -D warnings
- run: cargo build --release --locked --target aarch64-apple-darwin
- run: cargo build --release --locked --target x86_64-apple-darwin
- name: Prepare native-hid (deps + bundled Node.js runtime)
Expand All @@ -104,7 +112,8 @@ jobs:
target/x86_64-apple-darwin/release/openmouse-bridge \
-output openmouse-bridge
chmod +x openmouse-bridge
zip -r openmouse-bridge-macos-universal.zip openmouse-bridge README.md native-hid
cp assets/fonts/DM-Sans-OFL.txt ./DM-Sans-OFL.txt
zip -r openmouse-bridge-macos-universal.zip openmouse-bridge README.md DM-Sans-OFL.txt native-hid
shasum -a 256 openmouse-bridge-macos-universal.zip > openmouse-bridge-macos-universal.zip.sha256
- uses: actions/upload-artifact@v4
with:
Expand All @@ -120,13 +129,17 @@ jobs:
- name: Install Linux HID and GUI dependencies
run: sudo apt-get update && sudo apt-get install -y libudev-dev libgtk-3-dev libayatana-appindicator3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev libgl1-mesa-dev pkg-config
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
cache-dependency-path: native-hid/package-lock.json
- run: cargo fmt --check
- run: cargo test --locked
- run: cargo clippy --locked --all-targets -- -D warnings
- run: cargo build --release --locked
- name: Prepare native-hid (deps + bundled Node.js runtime)
run: |
Expand All @@ -145,7 +158,8 @@ jobs:
cp target/release/openmouse-bridge ./openmouse-bridge
chmod +x openmouse-bridge
cp assets/openmouse-app-icon.png ./openmouse-app-icon.png
zip -r openmouse-bridge-linux-x64.zip openmouse-bridge openmouse-app-icon.png README.md native-hid
cp assets/fonts/DM-Sans-OFL.txt ./DM-Sans-OFL.txt
zip -r openmouse-bridge-linux-x64.zip openmouse-bridge openmouse-app-icon.png README.md DM-Sans-OFL.txt native-hid
rm openmouse-bridge openmouse-app-icon.png
sha256sum openmouse-bridge-linux-x64.zip > openmouse-bridge-linux-x64.zip.sha256
- uses: actions/upload-artifact@v4
Expand Down
59 changes: 31 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sysinfo = "0.37"
tokio = { version = "1.47", features = ["macros", "net", "rt-multi-thread", "signal", "sync", "time"] }
tokio = { version = "1.47", features = ["fs", "macros", "net", "rt-multi-thread", "signal", "sync", "time"] }
tower-http = { version = "0.6", features = ["cors", "set-header", "trace"] }
tracing = "0.1"
tracing-appender = "0.2"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
zip = { version = "4.6", default-features = false, features = ["deflate"] }
zip = { version = "9.0", default-features = false, features = ["deflate"] }

[target.'cfg(any(target_os = "windows", target_os = "macos", target_os = "linux"))'.dependencies]
eframe = { version = "0.36.1", default-features = false, features = ["accesskit", "default_fonts", "glow", "wayland", "x11"] }
Expand All @@ -48,6 +48,8 @@ gtk = "0.18"
# X11 overlay banner and foreground-window lookup. Pure Rust; no system
# libraries beyond what eframe/tray-icon already require.
x11rb = "0.13"
# Virtual keyboard and mouse for the button listener (/dev/uinput).
libc = "0.2"

[target.'cfg(target_os = "macos")'.dependencies]
objc2 = "0.6.4"
Expand All @@ -70,6 +72,9 @@ objc2-app-kit = { version = "0.3.2", default-features = false, features = [
"NSWorkspace",
] }
objc2-foundation = { version = "0.3.2", default-features = false, features = ["NSArray", "NSData", "NSGeometry", "NSString"] }
# Posts the key and button events the button listener presses.
objc2-core-foundation = { version = "0.3.2", default-features = false, features = ["std", "CFCGTypes"] }
objc2-core-graphics = { version = "0.3.2", default-features = false, features = ["std", "CGEvent", "CGEventTypes", "CGRemoteOperation"] }

[target.'cfg(target_os = "windows")'.dependencies]
windows-sys = { version = "0.61", features = [
Expand All @@ -82,6 +87,10 @@ windows-sys = { version = "0.61", features = [
"Win32_System_Registry",
"Win32_System_Threading",
"Win32_UI_HiDpi",
"Win32_UI_Input_KeyboardAndMouse",
"Win32_UI_Shell",
"Win32_UI_WindowsAndMessaging",
] }

[dev-dependencies]
tower = { version = "0.5", features = ["util"] }
Loading
Loading